2

I am trying to setup pip for linux . I have python 12.7.12 on the system , pip is installed on the system

~/Desktop # sudo easy_install pip install_dir /usr/local/lib/python2.7/site-packages/ Searching for pip Best match: pip 9.0.1 Processing pip-9.0.1-py2.7.egg pip 9.0.1 is already the active version in easy-install.pth Installing pip script to /usr/local/bin Installing pip2.7 script to /usr/local/bin Installing pip2 script to /usr/local/bin 

from here it looks pip is installed properly , but when i am trying to use pip then it throws error .

 pip -V Traceback (most recent call last): File "/usr/local/bin/pip", line 9, in <module> load_entry_point('pip==9.0.1', 'console_scripts', 'pip')() File "/usr/local/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 305, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/local/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2244, in load_entry_point return ep.load() File "/usr/local/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 1954, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 28, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/vcs/mercurial.py", line 9, in <module> from pip.download import path_to_url File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 36, in <module> from pip.utils.glibc import libc_ver File "/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/glibc.py", line 4, in <module> import ctypes File "/usr/local/lib/python2.7/ctypes/__init__.py", line 7, in <module> from _ctypes import Union, Structure, Array ****ImportError: /usr/local/lib/python2.7/lib-dynload/_ctypes.so: undefined symbol: PyUnicodeUCS2_FromUnicode**** 

1 Answer 1

2

This is quite often a symptom of conflicting/erroneous Python installs, rather than Pip. I.E. they have been built and compiled differently.

Do you have multiple Python installations (or something like Travis CI installed/custom built installation)?

For reference - here is a similar issue on the Pip bug tracker

I'd suggest checking what Python installation Python is referencing when you try and run it - you can use something like:

import sys print(sys.executable) 

And/Or look at using virtualenv to isolate the python environment you are executing against.

As another reference, I believe again similar issue to this SO question.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, I did a clean installation my system then only 1 version of Python was there, everything worked fine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.