It’s easy to do, but hard to remember the correct spelling:
pip install mysqlclient
If you need 1.2.x versions (legacy Python only), use pip install MySQL-python
Note: Some dependencies might have to be in place when running the above command. Some hints on how to install these on various platforms:
Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie)
sudo apt-get install python-pip python-dev libmysqlclient-dev
Fedora 24:
sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
Mac OS
brew install mysql-connector-c
if that fails, try
brew install mysql
Related Posts:
- Install mysql-python (Windows)
- Escape string Python for MySQL
- How do I update\upgrade pip itself from inside my virtual environment?
- How do I update\upgrade pip itself from inside my virtual environment?
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- How to install pip with Python 3?
- ‘pip’ is not recognized as an internal or external command
- How to update/upgrade a package using pip?
- How do I update\upgrade pip itself from inside my virtual environment?
- How to update/upgrade a package using pip?
- How to use mysqli_query() in PHP?
- bash: pip: command not found
- bash: pip: command not found
- How to uninstall a package installed with pip install –user
- How to uninstall pip on OSX?
- How can I install packages using pip according to the requirements.txt file from a local directory?
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- ImportError: No module named pip
- ImportError: No module named pip
- “pip install unroll”: “python setup.py egg_info” failed with error code 1
- How do I install pip on macOS or OS X?
- Pip freeze vs. pip list
- How do I install pip on macOS or OS X?
- How can I install pip on Windows?
- “pip install unroll”: “python setup.py egg_info” failed with error code 1
- ImportError: No module named tensorflow
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- Column count doesn’t match value count at row 1
- Where is BeautifulSoup4 hiding?
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- MySQL string replace
- Cannot add or update a child row: a foreign key constraint fails
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- String concatenation in MySQL
- What’s the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]
- Where does pip install its packages?
- Cannot add or update a child row: a foreign key constraint fails
- MySQL Error “Operand should contain 1 column”
- Where does pip install its packages?
- How to install python3 version of package via pip on Ubuntu?
- Could not install packages due to an EnvironmentError:
- How to use MySQL DECIMAL?
- Access denied for user ‘root@localhost’ (using password:NO)
- Could not find a version that satisfies the requirement tensorflow
- How do I install a Python package with a .whl file?
- pip/python: normal site-packages is not writeable
- Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (38)
- How to make MySQL table primary key auto increment with some prefix
- Access denied for user ‘root@localhost’ (using password:NO)
- MySQL ERROR 1290 (HY000) –secure-file-priv option
- “Defaulting to user installation because normal site-packages is not writeable” python message
- Could not find a version that satisfies the requirement tensorflow
- How do I install a Python package with a .whl file?
- How to install pytorch in Anaconda with conda or pip?
- MySQL error 2006: mysql server has gone away
- “ssl module in Python is not available” when installing package with pip3
- Which MySQL data type to use for storing boolean values
- Can’t fix “zipimport.ZipImportError: can’t decompress data; zlib not available” when I type in “python3.6 get-pip.py”
- Configuring so that pip install can work from github
- import opencv vs import cv2
- No module named ‘psycopg2’
- Is #include
bad practice? - How to pip or easy_install tkinter on Windows
- sql query with multiple where statements
- python3 command not found after installing python with pyenv
- Conda uninstall one package and one package only
- pip or pip3 to install packages for Python 3?
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- Error after upgrading pip: cannot import name ‘main’
- filename.whl is not supported wheel on this platform
- ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
- Cannot delete or update a parent row: a foreign key constraint fails
- Cannot delete or update a parent row: a foreign key constraint fails
- “ssl module in Python is not available”
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- MySQL server startup error ‘The server quit without updating PID file’
- Permission denied error by installing matplotlib
- Updating matplotlib in virtualenv with pip
- Rename a column in MySQL
- ImportError: cannot import name main when running pip –version command in windows7 32 bit
- filename.whl is not a supported wheel on this platform
- E: unable to locate package pip
- “INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”
- Cannot delete or update a parent row: a foreign key constraint fails
- What is the difference between pip and conda?
- bash: pip: command not found
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- MySQL server startup error ‘The server quit without updating PID file’
- How do I restore a dump file from mysqldump?
- How to know the version of pip itself
- Syntax error due to using a reserved word as a table or column name in MySQL
- ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
- MySQL root password change
- Installation of MySQL for Visual Studio 1.2.8 failed
- Not unique table/alias
- How do I import an SQL file using the command line in MySQL?
- How to install pip3 on Windows?