Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Namespace' object has no attribute 'data_path' #1

Closed
aandriella opened this issue Jan 26, 2023 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@aandriella
Copy link

Hi,
when I try to run the code. I got the following error:
Exception has occurred: AttributeError 'Namespace' object has no attribute 'data_path' File "/home/antonioan/Documents/LanguageLearning/memograph/mg/options.py", line 209, in get_options if options.data_path is None: File "/home/antonioan/Documents/LanguageLearning/memograph/mg/main/__init__.py", line 16, in main options = get_options() File "/home/antonioan/Documents/LanguageLearning/memograph/mg/__main__.py", line 9, in <module> main() AttributeError: 'Namespace' object has no attribute 'data_path'

@matomatical
Copy link
Owner

matomatical commented Jan 27, 2023

You may be calling the program with no sub-command (drill, review, learn, etc.).
To fix the problem, try invoking the program as follows:

  • python3 -m mg --help
  • python3 -m mg status

but not

  • python3 -m mg (this seems to cause the error)

This should allow you to use the program (following the rest of the instructions). But, I still consider it a bug that when no subcommand is provided, the program crashes like this. I hadn't noticed that before, thanks for pointing it out, I will try to fix it so that by default a usage message is shown instead.

matomatical added a commit that referenced this issue Jan 27, 2023
@matomatical
Copy link
Owner

The above commit should fix the crash, if I was right that you were not providing a subcommand. The output when no subcommand is provided is now:

% python3 -m mg
usage: mg [-h] [-v] {drill,review,learn,status,info,checkup,history,recompute,commit,sync,missed} ...
mg: error: the following arguments are required: subcommand

If my guess was right (that you were not providing a subcommand), please reinstall and let me know if the issue is fixed for you, then I will close it. If my guess was wrong, please let me know if you still experience the issue, and let me know how you are invoking the program.

@matomatical matomatical self-assigned this Jan 27, 2023
@matomatical matomatical added the bug Something isn't working label Jan 27, 2023
@aandriella
Copy link
Author

Thank you! The commit fixed the current bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants