0

这篇文章(如何在 Mac OS X 上安装 MySQLdb(MySQL 的 Python 数据访问库)?)建议通过删除 python 鸡蛋来清理 MySQLdb 安装:

“步骤 3c:删除 Users/$USER/.python-eggs 下的 egg”

我不知道如何导航到该位置。我以为鸡蛋在 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ ?

请帮忙。

4

1 回答 1

0

Ususally my approach is to figure out where the first init.py file for the package is

For example

In [4]: import django 

In [5]: django.__file__
Out[5]: '/usr/local/lib/python2.7/dist-packages/django/__init__.pyc'

so essentially

when you do

import module 
module.__file__

However I have to say this is not the best way I would suggest use better package management or pip preferably with virtualenv to manage your python related package management issues.

于 2013-04-25T18:59:45.493 回答