开发者

Installing MySQLdb for Python on OSX 10.6 - Error Creating .egg

开发者 https://www.devze.com 2023-03-17 02:49 出处:网络
Running Python 2.7 X86 on Snow Leopard. Inst开发者_Python百科alled 64 bit MySQL to avoid conflicts between bit versions. However, still have issues installing MySQLdb.

Running Python 2.7 X86 on Snow Leopard. Inst开发者_Python百科alled 64 bit MySQL to avoid conflicts between bit versions. However, still have issues installing MySQLdb.

After following this and various other online guides I'm still no closer. The output I receive during install is:

$ ARCHFLAGS='-arch x86_64' python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-x86_64/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-x86_64-2.7/MySQLdb
running build_ext
copying build/lib.macosx-10.6-x86_64-2.7/MySQLdb/release.py -> build/bdist.macosx-10.6-x86_64/egg/MySQLdb
byte-compiling build/bdist.macosx-10.6-x86_64/egg/MySQLdb/release.py to release.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.macosx-10.6-x86_64/egg/_mysql.py to _mysql.pyc
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.6-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.6-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating 'dist/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg' and adding 'build/bdist.macosx-    10.6-x86_64/egg' to it
error: dist/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg: Permission denied

Anyone know where I am going wrong?


Chances are that at one point you tried running python setup.py under sudo and now have a dist directory belonging to root. Clear out the existing dist subdirectory in your build directory and rerun:

sudo rm -rf ./dist
ARCHFLAGS='-arch x86_64' python setup.py install

If you then get permission errors in the final install step, you may need to run the install step under sudo:

sudo bash
export ARCHFLAGS='-arch x86_64'
/path/to/same/python2.7 setup.py install
exit

but it's probably better to not do that if you don't have to.

0

精彩评论

暂无评论...
验证码 换一张
取 消