Mac OS X 和 Mamp Pro 上的 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,有谁知道如何解决这个问题,因为我没有主意了!?!?
I'm having trouble installing pip as it can't find my mysql_config file. I'm on a Mac I'm using Mamp Pro the config file is located here in Mamp: /Users/james/Applications/MAMP/tmp/mysql/my_cnf
I've changed the site.cfg file to point to this:
mysql_config = /Users/james/Applications/MAMP/tmp/mysql/my_cnf
Which didn't work. I've placed the mysql_config on my path via:
PATH=$PATH:/Users/james/Applications/MAMP/tmp/mysql/my_cnf
export PATH
The error I'm getting is:
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
What am I doing wrong? I would like to carry on using Mamp Pro, does anyone know how to fix this as I'm out of ideas!?!?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您正在使用 sudo 运行安装命令,因此您正在使用提升的帐户路径,该路径可能不包括 mysql_config。
试试这个:
并确保两者返回相同的 mysql_config 路径。
Since you are running install command with sudo you are using the elevated accounts path, that may not include mysql_config.
Try this:
and make sure both return the same path to mysql_config.