This question already has answers here:
pip install mysql-python fails with EnvironmentError: mysql_config not found
(24 answers)
mysql_config not found when installing mysqldb python interface
(36 answers)
Closed 1 year ago.
I'm trying to install mysqlclient on Ubuntu 20.04LTS, the main error is: mysql_config not found.
Whole Error:
$ pip3 install mysqlclient==2.0.3
Defaulting to user installation because normal site-packages is not writeable
Collecting mysqlclient==2.0.3
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qr1hc7jz/mysqlclient_1ff152ec2d5d4f14a4e282285faeb229/setup.py'"'"'; _file__='"'"'/tmp/pip-install-qr1hc7jz/mysqlclient_1ff152ec2d5d4f14a4e282285faeb229/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file_) if os.path.exists(_file_) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, _file_, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ehrlbbbl
cwd: /tmp/pip-install-qr1hc7jz/mysqlclient_1ff152ec2d5d4f14a4e282285faeb229/
Complete output (15 lines):
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-qr1hc7jz/mysqlclient_1ff152ec2d5d4f14a4e282285faeb229/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-qr1hc7jz/mysqlclient_1ff152ec2d5d4f14a4e282285faeb229/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-qr1hc7jz/mysqlclient_1ff152ec2d5d4f14a4e282285faeb229/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysqlclient==2.0.3 (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0rc1, 2.1.0)
ERROR: No matching distribution found for mysqlclient==2.0.3
(when trying to pip3 install mysqlclient, the same error apears, but every version tries to install)
You need to install the python3 and MySQL development headers and libraries like in your ubuntu OS,
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
then install using
pip3 install mysqlclient==2.0.3
I hope this will help you out
Related
I have a following problem. I would like to install MySQLdb. I try pip install mysqlclient but I got this error message:
Collecting mysqlclient
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ydedt20p/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ydedt20p/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-ydedt20p/mysqlclient/pip-egg-info
cwd: /tmp/pip-install-ydedt20p/mysqlclient/
Complete output (15 lines):
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ydedt20p/mysqlclient/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-ydedt20p/mysqlclient/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-ydedt20p/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I am using Python 3.8 on Ubuntu. How can I fix it, please?
Please read and follow the installation instructions for Linux.
For Ubuntu,
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
to install the required libraries before attempting to
pip install mysqlclient
I've been working on this over a week now, and the version problems just seem endless. I've downloaded a complex Django app, which has multiple install scripts. It is very complex.
I got an error that needed to be fixed by deleting Pipfile.lock, then I got some "missing module" errors and I manually did:
pip3 install importlib_metadata
pip3 install ConfigParser
but now I try:
pipenv lock
I get absolutely endless error messages, a small part of which looks like:
ERROR:pip.subprocessor:Command errored out with exit status 1:
command: /home/ec2-user/.local/share/virtualenvs/blueflow-c7ciKYpf/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pipenv-233zg4_c-build/psycopg2_a87c46885ac64bcd839843d942c021c6/setup.py'"'"'; __file__='"'"'/tmp/pipenv-233zg4_c-build/psycopg2_a87c46885ac64bcd839843d942c021c6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /tmp/pip-pip-egg-info-t04x5e3y
cwd: /tmp/pipenv-233zg4_c-build/psycopg2_a87c46885ac64bcd839843d942c021c6/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pipenv-233zg4_c-build/psycopg2_a87c46885ac64bcd839843d942c021c6/setup.py", line 225
except Warning, w:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR:pip.subprocessor:Command errored out with exit status 1:
command: /home/ec2-user/.local/share/virtualenvs/blueflow-c7ciKYpf/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pipenv-233zg4_c-build/psycopg2_4e8ce76ba6cc49a19dc4f3ec22a582aa/setup.py'"'"'; __file__='"'"'/tmp/pipenv-233zg4_c-build/psycopg2_4e8ce76ba6cc49a19dc4f3ec22a582aa/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /tmp/pip-pip-egg-info-liszsbkl
cwd: /tmp/pipenv-233zg4_c-build/psycopg2_4e8ce76ba6cc49a19dc4f3ec22a582aa/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pipenv-233zg4_c-build/psycopg2_4e8ce76ba6cc49a19dc4f3ec22a582aa/setup.py", line 50, in <module>
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
CRITICAL:pipenv.patched.notpip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement psycopg2 (from versions: 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.4, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.6, 2.6.1, 2.6.2, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.7.3.1, 2.7.3.2, 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9, 2.9.1, 2.9.2, 2.9.3)
[ResolutionFailure]: File "/usr/local/lib/python3.6/site-packages/pipenv/resolver.py", line 743, in _main
[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]: File "/usr/local/lib/python3.6/site-packages/pipenv/resolver.py", line 711, in resolve_packages
[ResolutionFailure]: requirements_dir=requirements_dir,
[ResolutionFailure]: File "/usr/local/lib/python3.6/site-packages/pipenv/resolver.py", line 693, in resolve
[ResolutionFailure]: req_dir=requirements_dir
[ResolutionFailure]: File "/usr/local/lib/python3.6/site-packages/pipenv/utils.py", line 1385, in resolve_deps
[ResolutionFailure]: req_dir=req_dir,
[ResolutionFailure]: File "/usr/local/lib/python3.6/site-packages/pipenv/utils.py", line 1106, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "/usr/local/lib/python3.6/site-packages/pipenv/utils.py", line 884, in resolve
[ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: No matching distribution found for psycopg2
but the heart of it seems to be:
ERROR: No matching distribution found for psycopg2
I'm trying to figure out how to install this, but I'm also curious if anyone has some meta level comment that might help resolve all of these errors.
I should add, I can do this:
pip3 install psycopg2-binary
which succeeds, but then when I do this:
pipenv lock
I still get:
ERROR: No matching distribution found for psycopg2
I also see this line:
"Defaulting to user installation because normal site-packages is not writeable"
If I knew where the normal site-packages was, I would make it writeable, but I have no idea.
If I try:
pip3 install psycopg2
I get:
Error: pg_config executable not found.
And also:
WARNING: Discarding https://files.pythonhosted.org/packages/19/79/35c7596bab4456f3610c12ec542a94d51c6781ced587d1d85127210b879b/psycopg2-2.0.10.tar.gz#sha256=e40cc04b43849085725076ae134bfef9e3b087f6dd7c964aeeb930e2f0bc14ab (from https://pypi.org/simple/psycopg2/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement psycopg2 (from versions: 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.4, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.6, 2.6.1, 2.6.2, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.7.3.1, 2.7.3.2, 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9, 2.9.1, 2.9.2, 2.9.3)
ERROR: No matching distribution found for psycopg2
I cannot afford to spend another week on this. I wonder if there is some way to break through and get everything working. Is there truly no way to get Python to do more of the work of figuring out what dependencies need to be installed?
I am building a flask project and I want to use MySQL database. I need flask-mysqldb as an ORM for that. So as a good practice, I created a virtual environment, install flask and other dependencies, and then for installing flask-mysqldb, I used pip install flask-mysqldb. This suddenly gives me bunch of errors. At first I realized, I dont have MySQL installed on my system. So even after installing it these errors won't go away. I also tried pip install Flask-MySQLdb don't know how this is different from the first command but same errors.
I tried searching for errors online regarding flask-mysqldb, but most of them relate to some mysql.h file error which doesn't show in my terminal logs.
(env) ck#ck-IdeaPad-Gaming-3-15ARH05:~/projects/opensoft/roomAlloc$ pip install Flask-MySQLdb
Collecting Flask-MySQLdb
Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Requirement already satisfied: Flask>=0.10 in ./env/lib/python3.8/site-packages (from Flask-MySQLdb) (2.0.2)
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
ERROR: Command errored out with exit status 1:
command: /home/ck/projects/opensoft/roomAlloc/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bra67idg/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bra67idg/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-bra67idg/mysqlclient/pip-egg-info
cwd: /tmp/pip-install-bra67idg/mysqlclient/
Complete output (15 lines):
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-bra67idg/mysqlclient/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-bra67idg/mysqlclient/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-bra67idg/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Please help me out, you can comment if you need more information.
I had the same error 2 minutes ago and find this command to solve the problem!
sudo apt-get install libmysqlclient-dev
the just try to install again and should work fine.
Credits:
I found this command here (In Spanish):
https://programmerclick.com/article/1483761552/
I used pip to install Kivy 1.10.0 (Yes! I need this version, no more, no less). But when I run pip install kivy==1.10.0, I got this:
C:\Users\FlopffyGrape> pip install kivy==1.10.0
Collecting kivy==1.10.0
Using cached Kivy-1.10.0.tar.gz (24.3 MB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\FlopffyGrape\AppData\Local\Programs\Python\Python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\FlopffyGrape\\AppData\\Local\\Temp\\pip-install-iiwz5ycz\\kivy_349a20b557a341848792819dc6f37ede\\setup.py'"'"'; __file__='"'"'C:\\Users\\FlopffyGrape\\AppData\\Local\\Temp\\pip-install-iiwz5ycz\\kivy_349a20b557a341848792819dc6f37ede\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\FlopffyGrape\AppData\Local\Temp\pip-pip-egg-info-fyg82ilx'
cwd: C:\Users\FlopffyGrape\AppData\Local\Temp\pip-install-iiwz5ycz\kivy_349a20b557a341848792819dc6f37ede\
Complete output (14 lines):
C:\Users\FlopffyGrape\AppData\Local\Temp\pip-install-iiwz5ycz\kivy_349a20b557a341848792819dc6f37ede\setup.py:69: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
MIN_CYTHON_VERSION = LooseVersion(MIN_CYTHON_STRING)
C:\Users\FlopffyGrape\AppData\Local\Temp\pip-install-iiwz5ycz\kivy_349a20b557a341848792819dc6f37ede\setup.py:71: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
MAX_CYTHON_VERSION = LooseVersion(MAX_CYTHON_STRING)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\FlopffyGrape\AppData\Local\Temp\pip-install-iiwz5ycz\kivy_349a20b557a341848792819dc6f37ede\setup.py", line 219, in <module>
from Cython.Distutils import build_ext
ModuleNotFoundError: No module named 'Cython'
Using distutils
Cython is missing, it's required for compiling kivy !
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/8c/49/5c22589099f9b7fd106502ee6634a6675e634d7553fede141a7606e6a92d/Kivy-1.10.0.tar.gz#sha256=28c180fd5e4538858f0d2b3dde53c123d3a898d3ac7fba512bf3b83d0dfc248d (from https://pypi.org/simple/kivy/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement kivy==1.10.0 (from versions: 1.0.1a0, 1.0.2a0, 1.0.3a0, 1.0.4b0, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.11.1, 2.0.0rc1, 2.0.0rc2, 2.0.0rc3, 2.0.0rc4, 2.0.0)
ERROR: No matching distribution found for kivy==1.10.0
But Cython is already installed (The version is 0.29.26).
How can I solve this? (I'm using Window 10 and Python 3.9.1)
you should reinstall cython (pip install cython).
I just switched from Windows to Mac and cloned my repository. I have the Mac Mini 2020 with the new m1 chip.
I ran pip3 install -r requirements.txt and got the following error:
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup.py", line 15, in <module>
metadata, options = get_config()
File "/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried with sudo after seeing another post about this issue:
sudo pip3 install -r requirements.txt and got this error:
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-h6hpe889
cwd: /private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup.py", line 15, in <module>
metadata, options = get_config()
File "/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysqlclient==2.0.3 (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3)
ERROR: No matching distribution found for mysqlclient==2.0.3
Versions:
Python 2.7.16
pip 19.2.3
When I run check my pip version it clearly shows python 3.8 there:
pip3 --version
pip 19.2.3 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
Any tips would be LOVELY!
I’ve also had similar experience with M1. I think it’s due to the mysql config. So first of all locate where your mysql_config is ( it can either be in /opt or /bin directories). For instance mine is in:
/opt/homebrew/bin
Once you’ve found the file, you need to edit the file with your favorite editor (I use nano) and change this line in the configuration:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
change it to this:
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
after editing install mysqlclient again. You can also ensure that gcc is already installed on your Mac