Install MySQL-Python (Windows)

Install mysql-python (Windows)

You're going to want to add Python to your Path Environment Variable in this way. Go to:

  1. My Computer
  2. System Properties
  3. Advance System Settings
  4. Under the "Advanced" tab click the button that says "Environment Variables"
  5. Then under System Variables you are going to want to add / change the following variables: PYTHONPATH and Path. Here is a paste of what my variables look like:

PYTHONPATH

C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts

Path

C:\Program Files\MySQL\MySQL Utilities 1.3.5\;C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts

Your Path's might be different, so please adjust them, but this configuration works for me and you should be able to run MySQL after making these changes.

Can't install mysql-python (newer versions) in Windows

I solved it myself.

I use the wheel installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python.

There are two wheel packages there. The amd64 one refuses to install on my platform (Windows) but the other one works just fine. I mean the file with this name:

MySQL_python-1.2.5-cp27-none-win32.whl

Then install it by running this below command in the same folder with the wheel package.

pip install MySQL_python-1.2.5-cp27-none-win32.whl

Python 3.7

Use mysqlclient‑1.3.13‑cp37‑cp37m‑win32.whl

How to fix the error coming pip install MySQL-python

Here is the error, looks like you need to install MS visual C++ 14.0

error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools
for Visual Studio": https://visualstudio.microsoft.com/downloads/
---------------------------------------- ERROR: Command errored out with exit status 1

How to install MySQL Connector for Python on Windows when according to the installation manager Python is not installed?

I could finally do it! In case someone else goes through the same nightmare as I had, here is the solution: instead of using command line I opened up Windows Power Shell and typed

pip install mysql-python

And it succeeded in downloading and Python script doesn't throw error anymore.

How to install Python MySQLdb module using pip?

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 Topics



Leave a reply



Submit