error: the following arguments are required: --path An exception has occurred, use %tb to see the full traceback. - ipython

project on https://github.com/linouk23/NBA-Player-Movements. Could you please let me know how to execute this project? I'm new to python. It'll help me to kick start my work on project. I'm executing my project on Spyder and installed all necessary libraries. I'm getting error as
usage: main.py [-h] --path PATH [--event EVENT]
main.py: error: the following arguments are required: --path
An exception has occurred, use %tb to see the full traceback.

For windows:
Open the extracted folder and press "shift + right click" and from there "Open command window here".
In cmd enter python main.py

Well, I tried in Jupyter Notebook and it failed, then I copied it in a .py file and run (Ubuntu) in terminal ,it worked.
I don't know how to solve the problem but I can 'avoid' this.

For the ones who are receiving this error, another thing to check is the way you are passing the arguments. Arguments are passed by adding two leading hyphens. So, when the error says
following arguments are required: example_arg
your code should be
parser.add_argument('--example_arg', 'arg1'). Note the two leading hyphens --

Related

trying to connect postgresql to go but I'm getting an error

I've imported a module called "github.com/lib/pq". before I ran my code, I inserted this in the terminal % go get github.com/lib/pq. Then when i tried to run my code, I'm getting an error message in the terminal
'no required module provides package github.com/lib/pq: go.mod file not found in current directory or any parent directory; see 'go help modules'
Running go mod tidy will sync your go.mod and go.sum file with the imports in your code, this will add missing dependencies and remove unnecessary ones. Should solve your issue.

C/C++ debugger failing to create and write to raise.c in WSL using VSCode

I am trying to develop in C on WSL(2) (using Ubuntu) for a university course but am having trouble using the built in debugger for C/C++ in VSCode (installed via the C/C++ extension.
For my testings, I am running this code:
#include <assert.h>
int main() {
assert(1==0);
return 0;
}
When running into the assert, the debugger errors and VSC displays the following message on the bottom right corner:
Unable to open 'raise.c': Unable to read file 'vscode-remote://wsl+ubuntu/build/glibc-eX1tMB/glibc-2.31/sysdeps/unix/sysv/linux/raise.c' (Error: Unable to resolve non-existing file 'vscode-remote://wsl+ubuntu/build/glibc-eX1tMB/glibc-2.31/sysdeps/unix/sysv/linux/raise.c').
I have tried every single tutorial, github issue and stackoverflow question's answer but nothing has worked.
I have reason to believe that this has to do with VSC not having some kind of permissions to write/create files because if I press on Create File (which is prompted in the message), It says:
Unable to write file 'vscode-remote://wsl+ubuntu/build/glibc-eX1tMB/glibc-2.31/sysdeps/unix/sysv/linux/raise.c' (NoPermissions (FileSystemError): Error: EACCES: permission denied, mkdir '/build')
but, if I create the folder /build and chmod 777 it, it is able to create the file, but not write anything into it.
Does anyone have a method to solve this?
Also, what is raise.c and why do I need it anyways?
According to the GDB skip function:https://sourceware.org/gdb/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html#Skipping-Over-Functions-and-FilesPuede add it to "SetupCommands" under "configurations" in Launch.json:
{
"description": "Skip glibc files",
"text": "-interpreter-exec console \"skip -gfi build/glibc-YYA7BZ/glibc-2.31//**/*\""
}
But no problem, add WSL + Ubuntu / or VSL + ubuntu, it will ignore the path, it does not solve the problem, which may be valid for other environments, but it is not valid if VSCode uses remote connection. According to article number 811:Disable "Unable to open file" during debugThe developers say that the "Skip" command is also looking online, currently (January 27, 2019) I do not know of any other way. But there are other solutions under this issue, no need to compile Glibc library:
Execute this:
$ sudo apt install glibc-source
$ cd /usr/src/glibc
$ sudo tar xvf glibc-2.31.tar.xz
The "2.31" should be changed to the actual version number Source, and can be seen through the "LS" command. Then add that in "settings" in Launch.json
"sourceFileMap": {
"/build/glibc-YYA7BZ": "/usr/src/glibc"
}
The "YYA7BZ" is changed to the GLIBC suffix appears in the error message. If this method is not valid, you can change the path to: c:/users//AppData/ / / /local packages canonicalGroupLimited.ubuntuonWindows_79RHKP1FNDGSC / /localstate / / rootfs usr/src/glibc, where 79RHKP1FNDGSC should change the folder name on your own system.
Now searching for terminal error information:
Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-p3q623bu.gbr" 1>"/tmp/Microsoft-MIEngine-Out-s4xm3p6g.lqk"
according to the error when executing: ends Call After launching an instance of 'std :: logic_error'This is caused by an empty pointer. One of the possible causes of this problem is that I forgot to add the necessary parameters to add a run program in the "Args" list in "Configurations" in Launch.json.
Source:https://programmerclick.com/article/54012533450/
See this procedure, similar error but in different environment.
https://stackoverflow.com/a/48287761/16842210
In my case, I used try{}catch{} to print the error and saw what was, had nothing to do with raise.c

Pylint Error: Attempted relative import beyond top-level package

Here in VSCode whenever I write the following line from . import dispatcher pylint always gives error statement saying Attempted relative import beyond top-level package.
But when I run the module using this command: python -m src.train the program runs without flashing any error. Here is the screenshot from the VSCode editor:
Does someone know who to solve this thing in VSCode?
Just add an empty __init__.py file of the folder that contains your dispatcher.py file, then all the .py files under the folder, as whole, should be recognized as a package. And the lint error should dismiss.

Error while importing gobblin gradle project into IDE

I am getting this error while I try to import the gobblin distribution into my IDE , I have tried both inteliJ and eclipse , not able to find any luck.
Below are the errors which I get when I try to import.
In Eclipse the error is:
*org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.3-bin.zip'.
*
For InteliJ
*Cause: startup failed: build file 'C:\Users\sayyad.ghazi\Desktop\gob\gobblin-master\gobblin-restli\gobblin-throttling-service\gobblin-throttling-service-api\build.gradle': 1: unexpected token: .. # line 1, column 1. ../../api.gradle ^ 1 error*
This is because on Windows, Git can not create symbolic link file on non-admins mode. Symbolic link file is created as text file, containing a symbolic link.
Try the following command in Administrator Mode:
git clone -c core.symlinks=true <URL>
Then check the content of symbolic link file, such as "build.gradle" in your description. It should be the same as the content of "../../api.gradle", not just a symbolic link.
See git-for-windows-wiki-Symbolic-Links for more details.

Compiling android native app calling ndk-build from eclipse, on ubuntu

On ubuntu 11.10 I installed eclipse from repositories, installed adt and cdt plugins. I am able to compile the hello-jni example using command line, but i would like to use eclipse for the task.
I followed the guide here: http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/ and defined a PATH variable in eclipse preferences (window->preferences->c/c++->environment), pointing to the ndk-r7b folder. But the project won't buid. I get this error:
(Cannot run program "ndk-build"
(in directory "/home/athos/android/ndk-r7b/samples/hello-jni"):
java.io.IOException:
error=2, File o directory non esistente)
(last line should be "no such file or directory" in english)
If I specify "${PATH}/ndk-build" or "/home/athos/android/ndk-r7b/ndk-build" as the build command. i get this:
/home/lavoro/android/ndk-r7b/ndk-build
ERROR: Cannot find 'make' program. Please install Cygwin make package
/home/lavoro/android/ndk-r7b/ndk-build: 40: dirname: not found
or define the GNUMAKE variable to point to it.
If I define the GNUMAKE variable in window->preferences->c/c++->environment i get this:
ERROR: Your GNUMAKE variable is defined to an invalid name: /usr/bin/make
Please fix it to point to a valid make executable (e.g. /usr/bin/make)
Which is funny, since It suggests the exact same directory I indicated. Make is installed and present at the indicated location.
What am I missing?
It's a bit ugly, but you can always put
/fully/qualified/path/to/ndk-build
In your build command.