Python no Longers sees MySQLdb

While writing my path through the list of scripts I need to write, I started using the package MySQLdb. All this worked fine in my terminal by doing a simple pythoncommand line, then import MySQLdb. However, after about 30 minutes, I decided it was better to port this to Eclipse, I start to make stupid mistakes ... Eclipse for some reason cannot see MySQLdb:

Unresolved import: MySQLdb  
MySQLdb Found at:

Then I continued to scratch my head and return to the terminal to see if this works ... and low and behold:

Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/MySQLdb/__init__.py", line 19, in <module>

  File "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/_mysql.py", line 7, in <module>
  File "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/_mysql.py", line 3, in __bootstrap__
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2553, in <module>
    working_set = WorkingSet()
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 384, in __init__
    self.add_entry(entry)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 399, in add_entry
for dist in find_distributions(entry, True):
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1647, in find_on_path
    path_item = _normalize_cached(path_item)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1794, in _normalize_cached
_cache[filename] = result = normalize_path(filename)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1788, in normalize_path
return os.path.normcase(os.path.realpath(filename))
  File "/usr/lib/python2.6/posixpath.py", line 364, in realpath
return abspath(filename)
  File "/usr/lib/python2.6/posixpath.py", line 337, in abspath
    path = join(os.getcwd(), path)
OSError: [Errno 2] No such file or directory
>>> 

I am completely confused as to what I have done. Can someone point out my stupid mistake and any solutions? I have yet to master this whole python / egg installation process. Greetings

+3
1
+2

Source: https://habr.com/ru/post/1753702/


All Articles