升级到OSX 10.11 El Capitan,现在不能使用MySQL与Python / Django [英] Upgraded to OSX 10.11 El Capitan, now cannot use MySQL with Python/Django

查看:84
本文介绍了升级到OSX 10.11 El Capitan,现在不能使用MySQL与Python / Django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我使用PyCharm管理的Python / Django项目。一切都在Mac OSX Yosemite下完美运行。今天早上我升级到El Capitan的最终版本,现在我无法运行该项目。我得到的错误是:


加载MySQLdb模块时出错:没有名为MySQLdb的模块


我已经尝试过去所有的建议,但没有一个解决了。最常见的建议似乎是:


sudo pip install MySQL-python


当我这样做时,我得到:


需求已经满足(使用 - 升级升级) :MySQL / python in /Library/Python/2.7/site-packages


其他建议都没有帮助。我可以尝试重新安装MySQL,但我不认为这是MySQL的破坏。这可能与权限有关。任何人都可以帮我让我重新开始吗?

解决方案

发生在我身上。我删除了软件包,使用 Homebrew 安装mysql,然后重新安装软件包。

  pip卸载MySQL-python 
brew安装mysql
点击安装MySQL-python

如果遇到任何问题,请务必检查他们的 El Capitan的疑难解答页面


I have a Python/Django project that I manage using PyCharm. Everything was working perfectly under Mac OSX Yosemite. This morning I upgraded to the final release version of El Capitan, now I cannot run the project. The error I get is:

Error loading MySQLdb module: No module named 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

When I do that, I get:

Requirement already satisfied (use --upgrade to 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. 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.

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.

这篇关于升级到OSX 10.11 El Capitan,现在不能使用MySQL与Python / Django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆