pycrypto error…ImportError: cannot import name Counter

ⅰ亾dé卋堺 提交于 2019-12-08 14:49:29

I can think of two things that may cause this.

Either you've made a file called "collections.py" and it's hiding the library module of the same name. If so, rename it.

If not, you've somehow messed up your python versions. Counter should definitely be in python 2.7.3. Try reinstalling python and double check what version you're actually running (e.g. by printing out sys.version_info somewhere inside your program).

To diagnose the problem, try import collections and print collections.__file__. It should be in the python2.7 directory. Open the file and search for class Counter.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!