Mac OS X和Mamp Pro上的pip安装错误

时间:2011-08-21 19:17:48

标签: django pip

我在安装pip时遇到问题,因为找不到我的mysql_config文件。我在Mac上我正在使用Mamp Pro,配置文件位于Mamp:/ Users / james / Applications / MAMP / tmp / mysql / my_cnf

我已将site.cfg文件更改为指向:

mysql_config = /Users/james/Applications/MAMP/tmp/mysql/my_cnf

哪个不起作用。我通过以下方式将mysql_config放在我的路径上:

PATH=$PATH:/Users/james/Applications/MAMP/tmp/mysql/my_cnf
export PATH

我得到的错误是:

Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/james/.pip/pip.log
(thecarbonlist)JamesApps:thecarbonlist james$ sudo pip install django mysql-python
Downloading/unpacking django
Running setup.py egg_info for package django
Downloading/unpacking mysql-python
Running setup.py egg_info for package mysql-python
sh: mysql_config: command not found
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "/Users/james/Projects/current/code/project/build/mysql-python/setup.py", line 15, in <module>
    metadata, options = get_config()
  File "setup_posix.py", line 43, in get_config
    libs = mysql_config("libs_r")
  File "setup_posix.py", line 24, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found

Traceback (most recent call last):

File "<string>", line 14, in <module>

File "/Users/james/Projects/current/code/project/build/mysql-python/setup.py", line 15, in <module>

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 24, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

我做错了什么?我想继续使用Mamp Pro,有没有人知道如何解决这个问题,因为我没有想法!?!?

1 个答案:

答案 0 :(得分:0)

由于您正在使用sudo运行install命令,因此您使用的是提升的帐户路径,该路径可能不包含mysql_config。

试试这个:

james$ which mysql_config
james$ sudo which mysql_config

并确保两者都返回到mysql_config的相同路径。