安装mysqldb时出错
在 mac osx 10.5 上安装 mysqldb 时:
sudo ../bin/python /Users/Awais/mysqlpython/setup.py install
我收到以下错误:
Traceback (most recent call last):
File "/Users/Awais/mysqlpython/setup.py", line 15, in <module>
metadata, options = get_config()
File "/Users/Awais/mysqlpython/setup_posix.py", line 32, in get_config
metadata, options = get_metadata_and_options()
File "/Users/Awais/mysqlpython/setup_common.py", line 7, in get_metadata_and_options metadata = dict(config.items('metadata'))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ConfigParser.py", line 564, in items
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'metadata'
When installing mysqldb on mac osx 10.5:
sudo ../bin/python /Users/Awais/mysqlpython/setup.py install
I get the following error:
Traceback (most recent call last):
File "/Users/Awais/mysqlpython/setup.py", line 15, in <module>
metadata, options = get_config()
File "/Users/Awais/mysqlpython/setup_posix.py", line 32, in get_config
metadata, options = get_metadata_and_options()
File "/Users/Awais/mysqlpython/setup_common.py", line 7, in get_metadata_and_options metadata = dict(config.items('metadata'))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ConfigParser.py", line 564, in items
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'metadata'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来你正在为Python安装MySQL,但你必须先安装MySQL。因此,首先从 http://dev.mysql.com/downloads/mysql/ 并安装它,然后尝试安装 MySQL for Python。
It seems that you are installing MySQL for Python but you have to have MySQL installed first. So, first download the MySQL installer from http://dev.mysql.com/downloads/mysql/ and install it and then try installing MySQL for Python.
我正在尝试将较旧的 Linux 服务器 RH EL 5 工作站移植到 CentOS 6.4 64 位。我必须做的两件事之一——因为我已经有一段时间没有构建基于 Python 的 MySQL 服务器了——是确保安装了 mysql-devel,并且从菜单软件安装,以及MySQL-python 已安装。
以这种方式安装 MySQL-python 的优点是 CentOS 6.4 发行版与 MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 匹配安装的 MySQL 版本 5.1.69。
在此之前,我尝试构建和安装 MySQL-python 但没有成功。在一个完美的世界里,我会找出原因,但是,就像很多事情一样,我已经到了最后期限,而且这很有效,并且在我在 SO 和其他地方读到的帖子中也得到了推荐。
I am trying port an older Linux server RH EL 5 Workstation to CentOS 6.4 64-bit. One of the two things I have had to do -- because it had been a while since I had built a Python-based MySQL server -- was make sure mysql-devel was installed, and from the menu-software install, as well as MySQL-python was installed.
The advantage to installing MySQL-python this way that the CentOS 6.4 distribution matches MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 matches the version of MySQL installed 5.1.69.
Prior to this, I tried building and installing MySQL-python with no success. In a perfect world, I would figure out why, but, like many things, I am on a deadline, and this worked, and was also recommended in posts I read both on SO and elsewhere.