簡體   English   中英

安裝python-mysql包時出現問題

[英]problems while installing python-mysql package

我有一個Ubuntu 12.04 x64服​​務器版VM,我正在運行python2.7並嘗試通過命令安裝MySQLdb軟件包(我已經安裝了easy_install並正常工作):

$ sudo easy_install MySQL-python

但是當easy_install嘗試編譯時,我收到以下回溯錯誤:

Traceback (most recent call last):
   File "/usr/local/bin/easy_install", line 9, in <module>
      load_entry_point('distribute', 'console_scripts', 'easy_install')()
   File "/usr/local/lib/python2.7/dist-packages/setuptools-1.1-py2.7.egg/pkg_resources.py", line 357, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
   File "/usr/local/lib/python2.7/dist-packages/setuptools-1.1-py2.7.egg/pkg_resources.py", line 2393, in load_entry_point
      raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found

我的/usr/local/lib/python2.7/dist-packages顯示了以下安裝包:

  • 分發-0.7.3-py2.7.egg
  • 易install.pth
  • pyinotify中-0.9.4-py2.7.egg
  • setuptools的-1.1-py2.7.egg
  • setuptools.pth

我不確定從哪里開始,或者為什么我甚至得到這個錯誤。 我也不確定這個問題是否更適合ServerFault; 但是,由於我在處理一些代碼時遇到了這個問題,我想也許其他一些編碼器也遇到過它......(當時似乎合乎邏輯)

您似乎已經安裝了distributesetuptools ,您的easy_install腳本嘗試從distribute加載入口點,但setuptools找到setuptools

您應該刪除distribute ,因為它已合並回setuptools ,現在已過時。 可能之后你需要重新安裝setuptools才能讓setuptools都重新工作。

嘗試以下方法:

curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py

然后再次運行sudo easy_install MySQL-python。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM