24👍
You need to install the following dependencies before installing mysqlclient for python 3.7 in your system.
sudo apt-get install python3.7-dev default-libmysqlclient-dev
I hope this will help you.
23👍
I installed the following library on Ubuntu and after that, the issue got resolved.
sudo apt-get install libssl-dev
and then I was able to install mysqlclient using the following command
pip install mysqlclient
- [Django]-Django models – how to filter number of ForeignKey objects
- [Django]-Dynamically add field to a form
- [Django]-Login Page by using django forms
5👍
currently the mysql-connector for python 3.7 is not available in official wesite but u can fix this issue by installing wheel with specific windows and python version.
this solutionpip install (ex/dir)/mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
for win 64-bi and python 3.7
check the link below and download the specific wheel for your system.
download and install the wheel for specific version by using “pip install (full path with file name in my case ex:-“pip install C:\Users\%user%\Downloads\mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl”)
- [Django]-Is it possible to pass query parameters via Django's {% url %} template tag?
- [Django]-Accessing dictionary by key in Django template
- [Django]-Django Rest Framework – Get related model field in serializer
5👍
This should work.
Do this first
sudo apt-get install python3.7-dev
And Then
pip install mysqlclient
- [Django]-Why is assertDictEqual needed if dicts can be compared by `==`?
- [Django]-Django – cannot import name 'config' from 'decouple'
- [Django]-Uwsgi installation error in windows 7
4👍
I installed it with the following command and works well now (on Mac):
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
see connected answer:
Error installing mysql-python: library not found for -lssl
- [Django]-Difference between 'related_name' and 'related_query_name' attributes in Django?
- [Django]-Uncaught TypeError: Cannot read property 'ownerDocument' of undefined
- [Django]-Django Rest Framework partial update
3👍
You have to install “mysqlclient-1.4.1-cp37-cp37m-win32.whl” (32bit) file
- Download 32bit file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
-
if your file is in Downloads folder write the command in your cmd
i.
cd C:\Users\Nour Noby\Downloads
[“Nour Noby” should be changed ]ii.
pip install mysqlclient-1.4.1-cp37-cp37m-win32.whl
[“mysqlclient-1.4.1-cp37-cp37m-win32.whl” should be replaced with your downloaded filename ].
- [Django]-How do I get the class of a object within a Django template?
- [Django]-Python (and Django) best import practices
- [Django]-What is the absolute path of BASE DIR?
2👍
As of 2019, here is how to run smoothly pip install mysqlclient
on MacOS:
brew info openssl
and follow the commands at the bottom
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
Other approaches:
brew install/upgrade/reinstall mysql
: did not fix the issue for me, but has the nice side effect to make sure your installation is clean.brew install mysql-connector-c
: to make that work you have to unlink mysql, which ruins your setup and it did not fix the issue for me.
- [Django]-QuerySet, Object has no attribute id – Django
- [Django]-How to test custom django-admin commands
- [Django]-How to strip html/javascript from text input in django
2👍
ensuring you have had done the needful with python…
and installing on the global level… (not virtual environment)
sudo apt-get install mysql-server
pip install --upgrade setuptools
I had come across the same problem, because I installed default Python2.7.15, and python3 would break even after doing the needful for Python (being python2)
something that worked for me was (effectively the last one is what made it work, but i think they were equally required on my virtualenvironment with python3)
sudo apt-get install libmysqlclient-dev
sudo apt-get install python3-pymysql
sudo apt-get install python3.6-dev
python3.7 in your case in the virtualenv
I also had to go through..
- [Django]-Django Model – Get distinct value list
- [Django]-ImportError: Couldn't import Django
- [Django]-Pipfile.lock out of date
- [Django]-Django / Comet (Push): Least of all evils?
- [Django]-How to find out the request.session sessionid and use it as a variable in Django?
- [Django]-Django data migration when changing a field to ManyToMany
0👍
In my case, I had the 32-bit version of Python installed, instead of the 64-bit one. Install 64-bit Python and it would work alright.
- [Django]-Django pre_save signal: check if instance is created not updated, does kwargs['created'] (still) exist?
- [Django]-Django REST Exceptions
- [Django]-How to quote a string value explicitly (Python DB API/Psycopg2)
0👍
Try alternative ‘MySQL Connector/Python’
- [Django]-Coverage.py warning: No data was collected. (no-data-collected)
- [Django]-Django 1.7 – How do I suppress "(1_6.W001) Some project unittests may not execute as expected."?
- [Django]-Django vs. Model View Controller
0👍
try to change python3 to python or python3.7-dev or as installed on your machine.
sudo apt-get install python3 default-libmysqlclient-dev
- [Django]-Coercing to Unicode: need string or buffer, NoneType found when rendering in django admin
- [Django]-Django – form has no errors but form.is_valid() doesn't validate
- [Django]-Django AutoField with primary_key vs default pk
- [Django]-Django TextField max_length validation for ModelForm
- [Django]-Django: How to build a custom form widget?
- [Django]-Class views in Django