pip2.7 gives ImportError(Entry point "console_scripts", "pip2.7" not found)

Created on 4 Jul 2017  路  1Comment  路  Source: pypa/pip

  • Pip version: 9.0.1
  • Python version: 2.7
  • Operating system: Linux/3.13.0-93-generic, 4.9.26, 4.7.0-0.bpo.1-amd64

Description:

When running pip2.7, an import error occurs.
When running pip - everything works as expected.

How was pip installed?

  • easy_install --upgrade pip

What I've run:

/usr/local/bin/pip2.7 --version
Error installing 'git-up': Traceback (most recent call last):
                File "/usr/local/bin/pip2.7", line 11, in <module>
                  load_entry_point('pip==9.0.1', 'console_scripts', 'pip2.7')()
                File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
                  return get_distribution(dist).load_entry_point(group, name)
                File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2648, in load_entry_point
                  raise ImportError("Entry point %r not found" % ((group, name),))
              ImportError: Entry point ('console_scripts', 'pip2.7') not found

If I modify /usr/local/bin/pip2.7 such that:

#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip2.7'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
    )

It loads the "pip" entry point, it works as expected.

OR

If I were to change /usr/local/lib/python2.7/dist-packages/pip-9.0.1.dist-info/entry_points.txt such that:

[console_scripts]
pip = pip:main
pip2.7 = pip:main
pip3 = pip:main
pip3.5 = pip:main

pip2.7 was included in the list of potential entry points, it works as expected.

I see now that this entry point is simply missing from setup.py: https://github.com/pypa/pip/blob/022248f6484fe87dc0ef5aec3437f4c7971fd14b/setup.py

invalid auto-locked

>All comments

easy_install --upgrade pip

I don't think this is a supported way to install pip; Please uninstall this installation of pip and install pip using get-pip.py bootstrapping script.

When running pip2.7, an import error occurs.

You're installing pip on Python 3.5. This obviously won't create a pip2.7 binary. The binaries it does create are pip, pip3 and pip3.5. If you do install pip on Python 2.7, the binaries created are pip, pip2, pip2.7.

It seems to be an artifact of installing pip through easy_install.

this entry point is simply missing from setup.py

Nope. It's there - https://github.com/pypa/pip/blob/022248f6484fe87dc0ef5aec3437f4c7971fd14b/setup.py#L83


Closing this issue as invalid.

Was this page helpful?
0 / 5 - 0 ratings