Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Lion上安装MySQLdb有困难-导入找不到模块_Python_Mysql_Mysql Python - Fatal编程技术网

Python 在Lion上安装MySQLdb有困难-导入找不到模块

Python 在Lion上安装MySQLdb有困难-导入找不到模块,python,mysql,mysql-python,Python,Mysql,Mysql Python,我很难让MySQLdb为以下对象工作: OSX 10.7.3 Python 2.7.1(64位) MySQL 5.1.62-osx10.6-x86_64 版本14.14发行版5.1.62,适用于使用readline 5.1的apple-darwin10.3.0(i386)(这有冲突吗?在安装64之前,我有一个32位版本) MySQLdb 1.2.3 安装的安装工具 我需要MySQL 5.1以符合我正在使用的站点 当我在python中“导入mysqldb”时,我得到“没有名为mysqldb

我很难让MySQLdb为以下对象工作:

  • OSX 10.7.3
  • Python 2.7.1(64位)
  • MySQL 5.1.62-osx10.6-x86_64
    • 版本14.14发行版5.1.62,适用于使用readline 5.1的apple-darwin10.3.0(i386)(这有冲突吗?在安装64之前,我有一个32位版本)
  • MySQLdb 1.2.3
  • 安装的安装工具
我需要MySQL 5.1以符合我正在使用的站点

当我在python中“导入mysqldb”时,我得到“没有名为mysqldb的模块”

谢谢你帮助我!让我知道我应该尝试什么


python路径包括

'/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg'
sudo python setup.py安装已经完成

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.7-intel/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.7-intel-2.7/MySQLdb
running build_ext
creating build/bdist.macosx-10.7-intel/egg
copying build/lib.macosx-10.7-intel-2.7/_mysql.so -> build/bdist.macosx-10.7-intel/egg
copying build/lib.macosx-10.7-intel-2.7/_mysql_exceptions.py -> build/bdist.macosx-10.7-intel/egg
creating build/bdist.macosx-10.7-intel/egg/MySQLdb
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/__init__.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/connections.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb
creating build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/__init__.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/CLIENT.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/CR.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/ER.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/FLAG.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/constants/REFRESH.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb/constants
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/converters.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/cursors.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/release.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb
copying build/lib.macosx-10.7-intel-2.7/MySQLdb/times.py -> build/bdist.macosx-10.7-intel/egg/MySQLdb
byte-compiling build/bdist.macosx-10.7-intel/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/connections.py to connections.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/CR.py to CR.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/ER.py to ER.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/converters.py to converters.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/cursors.py to cursors.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/release.py to release.pyc
byte-compiling build/bdist.macosx-10.7-intel/egg/MySQLdb/times.py to times.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.macosx-10.7-intel/egg/_mysql.py to _mysql.pyc
creating build/bdist.macosx-10.7-intel/egg/EGG-INFO
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.7-intel/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.7-intel/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.macosx-10.7-intel/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.7-intel/egg/EGG-INFO
writing build/bdist.macosx-10.7-intel/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.7-intel.egg' and adding 'build/bdist.macosx-10.7-intel/egg' to it
removing 'build/bdist.macosx-10.7-intel/egg' (and everything under it)
Processing MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg
Removing /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg
Copying MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg to /Library/Python/2.7/site-packages
MySQL-python 1.2.3 is already the active version in easy-install.pth

Installed /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg
Processing dependencies for MySQL-python==1.2.3
Finished processing dependencies for MySQL-python==1.2.3

尝试导入MySQLdb;导入是区分大小写的,此模块有愚蠢的大小写。

这是一个令人尴尬、有用的教训。非常感谢您的及时答复!