Project

General

Profile

Actions

Install pymysql on Windows PC » History » Revision 1

Revision 1/4 | Next »
Anchi Cheng, 12/09/2021 05:20 PM


Install pymysql on Windows PC

Windows installation on Windows PC is complicated by python2.7 is ancient and pymysql install only works with pip. Almost all instruction for installing pip requires internet access to get dependencies and preinstalled pip. If you have neither, here is what we found works.

Downloads

package version that works for python2.7 File available at this site for convenience
setuptools 41.6.0 setuptools-41.6.0.zip
wheel 0.36.2 wheel-0.36.2.tar.gz
pip 20.3.4 pip-20.3.4.tar.gz
pymysql 1.0.2 PyMySQL-0.10.1-py2.py3-none-any.whl

Do this on a computer where you can uncompress tar.gz and zip files and then transfer these uncompressed files to Windows PC you need to install pymysql

Install pip

We will install the two dependencies setuptools and wheel before installing pip

install setuptools

Let's say the uncompressed folder is D:\setuptools-41.6.0

1. Open Windows power shell or other commandline tool.

cd D:\setuptools-41.6.0
C:\Python27\python.exe setup.py install
  • If you get error complaining pythonpath syntax error from leginon setup, disable that environment variable byt changing its variable name for now.*

Install wheel

Same procedure as above but first change directory to be inside the uncompressed wheel-0.36.2 folder

Install pip

Same procedure as above but first change directory to be inside the uncompressed pip-20.3.4 folder

install pymysql with pip

Let's say that the wheel file for pymysql is at D:\PyMySQL-0.10.1-py2.py3-none-any.whl
In the Windows power shell

C:\Python27\Scripts\pip.exe install D:\PyMySQL-0.10.1-py2.py3-none-any.whl

testing

Start python command line interface and import pymysql

Updated by Anchi Cheng about 3 years ago · 1 revisions