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

json import error #47

Closed
tw00 opened this issue Jan 14, 2011 · 5 comments
Closed

json import error #47

tw00 opened this issue Jan 14, 2011 · 5 comments
Labels

Comments

@tw00
Copy link

tw00 commented Jan 14, 2011

When starting bravo I get the following error:

File "/usr/lib64/python2.6/site-packages/Bravo-1.0-py2.6.egg/bravo/serializers/json.py", line 12, in <module>
    raise ImportError("Couldn't find a JSON library!")
ImportError: Couldn't find a JSON library!

I think it's because in json.py there is an "import json", which in this case refers to json.py instead of json the library.

Best Regards
tw00

@MostAwesomeDude
Copy link
Contributor

Off the top of my head, this shouldn't be the case because relative module imports don't include the modules themselves. Try it; a test.py with "import test" in it won't cause a recursive import. I'll see if I can reproduce this tomorrow.

@tw00
Copy link
Author

tw00 commented Jan 18, 2011

This is what I get:

tw@machine: ~/minecraft_server/_test $ cat json.py
import json
def foo(): pass
print (json)

tw@machine: ~/minecraft_server/_test $ python2.6 json.py
<module 'json' from '/home/tw/minecraft_server/_test/json.py'>
<module 'json' from '/home/tw/minecraft_server/_test/json.py'>

tw@machine: ~/minecraft_server/_test2 $ cat test.py 
import json
def bar(): pass
print(json)

tw@machine: ~/minecraft_server/_test2 $ python2.6 test.py 
<module 'json' from '/usr/lib64/python2.6/json/__init__.pyc'>

Btw. awesome project! Keep it up!

@MostAwesomeDude
Copy link
Contributor

Bizarre; I just reproduced this on a fresh Gentoo box with Python 2.6. I guess the JSON imports need to be cleaned up at some point.

@MostAwesomeDude
Copy link
Contributor

JSON's no longer the default, so I'm closing this.

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

No branches or pull requests

2 participants