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 'read' How should I do? #14

Open
XD-mu opened this issue Dec 12, 2023 · 2 comments
Open

Comments

@XD-mu
Copy link

XD-mu commented Dec 12, 2023

Hello author, I encountered this error when running your code and cannot solve it. What is the reason? The environment and dependent libraries I configured according to your documentation are the same.

Traceback (most recent call last):
File "./main.py", line 21, in
config = Config(args)
File "/home/mcy/miniconda3/envs/python36/lib/python3.6/site-packages/config/init.py", line 709, in init
self.load(stream_or_path)
File "/home/mcy/miniconda3/envs/python36/lib/python3.6/site-packages/config/init.py", line 803, in load
items = p.container()
File "/home/mcy/miniconda3/envs/python36/lib/python3.6/site-packages/config/parser.py", line 285, in container
self.advance()
File "/home/mcy/miniconda3/envs/python36/lib/python3.6/site-packages/config/parser.py", line 130, in advance
self.token = self.tokenizer.get_token()
File "/home/mcy/miniconda3/envs/python36/lib/python3.6/site-packages/config/tokens.py", line 997, in get_token
c = get_char()
File "/home/mcy/miniconda3/envs/python36/lib/python3.6/site-packages/config/tokens.py", line 802, in get_char
c = self.stream.read(1)
AttributeError: 'Namespace' object has no attribute 'read'

@Pilhyeon
Copy link
Owner

I am not sure, but it seems like L21 of the "main.py" calls the init function of the external "config" module.

It is an unexpected behavior, because the purpose of the line is to generate a "Config" object of "config.py".

You may check this.

@XD-mu
Copy link
Author

XD-mu commented Dec 12, 2023

Thanks to the author for your timely answer. My problem has been solved after updating main.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants