Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name ABCMeta - Python Error in PyDev on Linux

Tags:

python

pydev

I came across this strange error while writing code using PyDev on Linux. Even a simple code like this produces error

print 'Hello World'

and the error is here

True
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 62, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 398, in <module>
    import UserDict
  File "/usr/lib/python2.7/UserDict.py", line 83, in <module>
    import _abcoll
  File "/usr/lib/python2.7/_abcoll.py", line 11, in <module>
    from abc import ABCMeta, abstractmethod
ImportError: cannot import name ABCMeta

my module is named sample.py. Please help me. Thanks

like image 721
reFORtEM Avatar asked Apr 23 '12 00:04

reFORtEM


1 Answers

My guess is that you have a file named either abc.py or abc.pyc in your working directory or PYTHONPATH and that one shadows the stdlib abc module.

like image 69
TryPyPy Avatar answered Oct 16 '22 10:10

TryPyPy