pip isn't working when importing something

2019-08-01 00:38发布

问题:

To install pymongo for pypy3 2.1 Beta 1, I installed pip using the following commands:

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
./pypy ez_setup.py --user

where pypy is the executable of pypy3 2.1 Beta 1. After that, pip and pip-3.2 will come to the current directory. But when running pip or pip-3.2, I get the error:

Traceback (most recent call first):
  File "pip-3.2", line 5, in <module>
    from pkg_resources import load_entry_point
zipimport.ZipImportError: pip==1.4.1

It seems that the problem comes from from pkg_resources import load_entry_point of the pip/pip-3.2. But this statement runs OK when I put it in pypy or python3 IDLE. What's the matter? How to solve this problem and proceed to install pymongo for pypy3 2.1 Beta 1? Thank you.

PS: I'm using Ubuntu. python3 is installed in the system. If u need any other information pertaining to solving the question, please comment.