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

发布于 2024-11-30 19:54:38 字数 1896 浏览 0 评论 0原文

我在安装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑脸一如从前 2024-12-07 19:54:38

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

试试这个:

james$ which mysql_config
james$ sudo which 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:

james$ which mysql_config
james$ sudo which mysql_config

and make sure both return the same path to mysql_config.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文