简体   繁体   中英

'pip install pymongo' stopped working

What do I do wrong?

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==7.1.0', 'console_scripts', 'pip')()
  File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-    py3.4.egg/pkg_resources/__init__.py", line 558, in load_entry_point
  File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 2682, in load_entry_point
  File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 2355, in load
  File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 2361, in resolve
ImportError: No module named 'pip'

Stackoverflow asked me to type more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more

Try to fix pip installation with:

sudo apt-get install python3-pip

I've had the same issue and this worked for me. Maybe it's because you only installed pip for an earlier version of python or you intalled it from source and not from you distributions package management.

It sounds like your pip variable isn't set or you're trying to use conflicting environments. If you want to get the python package pymongo installed on your 3.4 version look to use:

/usr/local/bin/pip3.4 install pymongo

Then you can verify by testing in the 3.4 interpreter by running:

python3.4
>>>import pymongo
>>>

In the future look at using virtualenvs, they can be really easy and clean to work with while controlling your packages neatly. Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM