![]() Self.models_module = import_module(models_module_name)įile "/Users/aaronkurz/opt/anaconda3/lib/python3.8/importlib/_init_.py", line 127, in import_module In /Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/MySQLdb/_ĭuring handling of the above exception, another exception occurred:įile "/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/django/core/management/_init_.py", line 419, in execute_from_command_lineįile "/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/django/core/management/_init_.py", line 395, in executeįile "/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/django/_init_.py", line 24, in setupįile "/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populateįile "/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/django/apps/config.py", line 301, in import_models Referenced from: /Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/MySQLdb/_ ImportError: dlopen(/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/MySQLdb/_, 2): Symbol not found: _mysql_affected_rows auto generating the models python manage.py inspectdb THIS IS WHERE THE ERROR OCCURS:įile "/Users/aaronkurz/Dev/2/good-env/lib/python3.8/site-packages/MySQLdb/_init_.py", line 18, in.Successfully installed mysql-connector-python-8.0.24 protobuf-3.15.8 six-1.16.0 Installing collected packages: six, protobuf, mysql-connector-python Using cached mysql_connector_python-8.0.24-py2.p圓-none-any.whl (319 kB) You should consider upgrading via the '/Users/aaronkurz/Dev/2/good-env/bin/python3 -m pip install -upgrade pip' command. Installing collected packages: mysqlclient Installing required drivers (I know only mysqlclient should suffice, but that led to the same result so I started trying to install both.).Creating a project django-admin startproject climatevisual cd climatevisual.You should consider upgrading via the '/Users/aaronkurz/Dev/2/good-env/bin/python -m pip install -upgrade pip' command. WARNING: You are using pip version 20.1.1 however, version 21.1.1 is available. Installing collected packages: sqlparse, asgiref, pytz, Django Using cached asgiref-3.3.4-p圓-none-any.whl (22 kB) Using cached sqlparse-0.4.1-p圓-none-any.whl (42 kB) Installing django python -m pip install Djangoĭownloading Django-3.2.2-p圓-none-any.whl (7.9 MB).Activate venv source good-env/bin/activate.create new python venv python3 -m venv good-env.Open MySQL Database dump insert use climate at the top of file, run script -> Database is ready Start MySQL brew services start MySQL Workbench and connect via password Here is my steps and all the terminal output: So, I am having trouble connecting Django to an existing MySQL database (created from a dump for dev purposes). Now you can Start of stop MySQL Server use following commands: rver start mysql.UPDATE: I found a solution and possible cause posted an answer with steps to make it work below. If you do not want to start MySQL automatically, first you need to stop the MySQL brew service: brew services stop mysql The following command will ensure that the MySQL server will start on each restart of your computer. mysqladmin -u root password 'your-password-for-root-user' Start MySQL using Brew Services ![]() I would suggest setting root password unless you are 100% sure that you are not going to store any sensitive/secrete information. Install MySQL brew install mysql Set Root Password* ![]()
0 Comments
Leave a Reply. |