Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu 12.04 and I have weird problem that started appearing. I've been using virtualenv command for working with my Python projects and I never had trouble with it. However, for some reason (I really don't know what) now it doesn't work anymore. I've tried to create new virtualenvironment for one of my projects but it keeps giving me error:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 10, in <module>
    from pip.util import get_installed_distributions, get_prog
  File "/usr/local/lib/python2.7/dist-packages/pip/util.py", line 8, in <module>
    import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/usr/lib/python2.7/io.py", line 60, in <module>
    import _io
ImportError: /usr/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyExc_TypeError
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 16, in <module>
    from xml.parsers.expat import ExpatError
  File "/usr/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: PyExc_TypeError

Original exception was:
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 10, in <module>
    from pip.util import get_installed_distributions, get_prog
  File "/usr/local/lib/python2.7/dist-packages/pip/util.py", line 8, in <module>
    import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/usr/lib/python2.7/io.py", line 60, in <module>
    import _io
ImportError: /usr/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyExc_TypeError

Do you have any idea why is that and how to fix it? Thanks

share|improve this question

1 Answer 1

This error means that the dynloader tried to find PyExc_TypeError call entries and couldn't find any.

This error often happens if you use different libraries which are not binary compatible.

You are not saying where you virtualenv have. Have you downloaded binaries, or is it the dist package? So try to get the right version.

share|improve this answer
    
it's dist package. I've removed it and installed it againg and now it works. But I'm still not sure why that appeared from nowhere because it was working without any problems until today. But never mind, thanks anyway –  ivan.zd Mar 20 at 23:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.