简体   繁体   English

在Mac上安装Django + MySql

[英]Installing Django+MySql on mac

I have been trying to install Django and mysql on my mac for days and it is driving me crazy :) I have successfully installed Django on 2 of my other mac machines but I can't manage to do that on MacBook Pro with latest os. 我已经尝试在Mac上安装Django和mysql数天了,这让我发疯了:)我已经在其他2台Mac机器上成功安装了Django,但是我无法在装有最新OS的MacBook Pro上进行安装。 I have installed Python 3.6 in Anaconda virtual environment. 我已经在Anaconda虚拟环境中安装了Python 3.6。 Then I installed mysql using brew install mysql@5.7 , I have installed Django using pip install django==2 and even pip install mysqlclient When i try to run python manage.py i am getting: 然后我使用brew install mysql@5.7安装了mysql,我已经使用pip install django==2甚至是pip install mysqlclient pip install django==2当我尝试运行python manage.py时,我得到了:

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. django.core.exceptions.ImproperlyConfigured:加载MySQLdb模块时出错。 Did you install mysqlclient? 您安装了mysqlclient吗?

I have tried to install mysql@5.6 with brew but i have uninstalled it. 我试图用brew安装mysql@5.6,但是我已经卸载了它。

Can somebody please help 有人可以帮忙吗

Install Anaconda Distribution for Mac https://www.anaconda.com/download/#macos and then you can install the Django and MYSQL Client using the following commands. 安装适用于Mac的Anaconda Distribution https://www.anaconda.com/download/#macos ,然后可以使用以下命令安装Django和MYSQL Client。

conda install -c anaconda django
conda install -c anaconda mysqlclient 

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

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