ImportError: No module named pip

前端 未结 19 686
时光取名叫无心
时光取名叫无心 2020-12-04 06:56

OS: Mac OS X 10.7.5 Python Ver: 2.7.5

I have installed setuptools 1.0 with ez_setup.py from https://pypi.python.org/pypi/setuptools Then I download pip.1.4.1 pkg fr

相关标签:
19条回答
  • 2020-12-04 07:43

    I think none of these answers above can fix your problem.

    I was also confused by this problem once. You should manually install pip following the official guide pip installation (which currently involves running a single get-pip.py Python script)

    after that, just sudo pip install Django. The error will be gone.

    0 讨论(0)
  • 2020-12-04 07:44

    my py version is 3.7.3, and this cmd worked

    python3.7 -m pip install requests

    requests library - for retrieving data from web APIs.

    This runs the pip module and asks it to find the requests library on PyPI.org (the Python Package Index) and install it in your local system so that it becomes available for you to import

    0 讨论(0)
  • 2020-12-04 07:45

    I downloaded pip binaries from here and it resolved the issue.

    0 讨论(0)
  • 2020-12-04 07:45

    Followed the advise on this URL, to rename the python39._pth file. That solved the issue

    https://michlstechblog.info/blog/python-install-python-with-pip-on-windows-by-the-embeddable-zip-file/#more-5606

    ren python39._pth python39._pth.save
    
    0 讨论(0)
  • 2020-12-04 07:46

    Tested below for Linux: You can directly download pip from https://pypi.org/simple/pip/ untar and use directly with your latest python.

    tar -xvf  pip-0.2.tar.gz
    cd pip-0.2
    

    Check for the contents.

    anant$ ls
    docs  pip.egg-info  pip-log.txt  pip.py  PKG-INFO  regen-docs  scripts  setup.cfg  setup.py  tests
    

    Execute directly:

    anant$ python pip.py --help
    Usage: pip.py COMMAND [OPTIONS]
    
    Options:
      --version             show program's version number and exit
      -h, --help            show this help message and exit
      -E DIR, --environment=DIR
                            virtualenv environment to run pip in (either give the
                            interpreter or the environment base directory)
      -v, --verbose         Give more output
      -q, --quiet           Give less output
      --log=FILENAME        Log file where a complete (maximum verbosity) record
                            will be kept
      --proxy=PROXY         Specify a proxy in the form
                            user:passwd@proxy.server:port. Note that the
                            user:password@ is optional and required only if you
                            are behind an authenticated proxy.  If you provide
                            user@proxy.server:port then you will be prompted for a
                            password.
      --timeout=SECONDS     Set the socket timeout (default 15 seconds)
    
    0 讨论(0)
  • 2020-12-04 07:50

    After installing ez_setup, you should have easy_install available. To install pip just do:

    easy_install pip
    
    0 讨论(0)
提交回复
热议问题