【问题标题】:Can't install mysqlclient-python on Linux Ubuntu无法在 Linux Ubuntu 上安装 mysqlclient-python
【发布时间】:2015-08-19 01:45:42
【问题描述】:

我目前正在尝试在 ubuntu 上安装 mysqlclient-python 以与 Django 一起使用,但遇到了问题。

我正在关注这个页面:https://github.com/PyMySQL/mysqlclient-python

但是,当我运行“pip install mysqlclient”时,出现以下错误:

running install_lib

copying build/lib.linux-x86_64-2.7/_mysql_exceptions.py -> /usr/local/lib/python2.7/dist-packages

error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/_mysql_exceptions.py'

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_robofish/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ynYYW0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_robofish/mysqlclient
Storing debug log for failure in /home/robofish/.pip/pip.log

我检查了/usr/local/lib/python2.7/ 目录,它似乎是空的。会不会是这个问题?

【问题讨论】:

    标签: python linux django python-2.7 ubuntu


    【解决方案1】:

    您似乎正在尝试在全局 Python 环境中安装 mysqlclient。我强烈建议使用virtualenv 创建一个独立的 Python 环境。

    如果您仍想使用全局环境,请使用sudo pip install mysqlclient

    【讨论】:

      猜你喜欢
      • 2018-05-02
      • 2022-07-20
      • 2020-01-13
      • 1970-01-01
      • 2018-04-13
      • 2022-01-15
      • 2021-01-06
      • 2018-01-08
      • 2020-02-26
      相关资源
      最近更新 更多