commentjson: Import not working on Windows, Python 3.4
pip install commentjson
python
>>> import commentjson
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\PyEnvs\3.4\lib\site-packages\commentjson\__init__.py", line 1, in <module>
from commentjson import dump
ImportError: cannot import name 'dump'
>>>
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 2
- Comments: 16 (1 by maintainers)
@gabyx Read the thread. 😃 JSON_minify [1] is where to switch.
[1] https://pypi.python.org/pypi/JSON_minify
It’s not working in OS X either, so I submitted a PR; the problem should be fixed.
As @WindWang2 described, pip install, then
mv commentjson.py __init__.pyis the first step to solve problem. I also need to change all the occurrence ofexcept Exception, e:intoexcept Exception as e:to finally make it work.I solved the problem without
mv commentjson.py __init__.py. I have just replaced allfrom commentjsonwithfrom .commentjsonin__init__.py.