简体   繁体   English

升级到OSX 10.11 El Capitan,现在不能使用MySQL和Python / Django

[英]Upgraded to OSX 10.11 El Capitan, now cannot use MySQL with Python/Django

I have a Python/Django project that I manage using PyCharm. 我有一个使用PyCharm管理的Python / Django项目。 Everything was working perfectly under Mac OSX Yosemite. 在Mac OSX Yosemite下,一切都运行良好。 This morning I upgraded to the final release version of El Capitan, now I cannot run the project. 今天早上我升级到El Capitan的最终版本,现在我无法运行该项目。 The error I get is: 我得到的错误是:

Error loading MySQLdb module: No module named MySQLdb 加载MySQLdb模块时出错:没有名为MySQLdb的模块

I've tried all the suggestions from past questions, but none has resolved it. 我已经尝试了过去问题的所有建议,但没有人解决它。 The most common suggestion seems to be: 最常见的建议似乎是:

sudo pip install MySQL-python sudo pip安装MySQL-python

When I do that, I get: 当我这样做时,我得到:

Requirement already satisfied (use --upgrade to upgrade): MySQL-python in /Library/Python/2.7/site-packages 要求已经满足(使用--upgrade升级):MySQL-python in /Library/Python/2.7/site-packages

None of the other suggestions help either. 其他建议都没有帮助。 I can try reinstalling MySQL, but I don't think it's the MySQL that's broken. 我可以尝试重新安装MySQL,但我认为这不是MySQL的破坏。 This might have something to do with permissions. 这可能与权限有关。 Can anyone please help get me going again? 任何人都可以帮助我再次去吗?

Happened to me as well. 也发生在我身上。 I removed the package, installed mysql using Homebrew and then reinstall the package. 我删除了包,使用Homebrew安装了mysql,然后重新安装了包。

pip uninstall MySQL-python
brew install mysql
pip install MySQL-python

If you run into any issues with brew, be sure to check their troubleshooting page on El Capitan . 如果您遇到任何brew问题,请务必查看El Capitan上故障排除页面

View this post : MySQL Improperly Configured Reason: unsafe use of relative path 查看此帖子: MySQL配置错误原因:不安全使用相对路径

And if you have updated Xcode, open 1 time Xcode for agreement the licence. 如果您更新了Xcode,请打开一次Xcode以获得许可协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM