Project

General

Profile

Install pymysql on Windows PC » History » Revision 2

Revision 1 (Anchi Cheng, 12/09/2021 05:20 PM) → Revision 2/4 (Anchi Cheng, 12/09/2021 05:46 PM)

h1. Install pymysql on Windows PC 

 Windows installation on Windows PC is installed from a local download 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. 

 h2. 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* 

 h2. Install pip 

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

 h3. install setuptools 

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

 1. Open Windows power shell or other commandline tool. 

 <pre> 
 cd D:\setuptools-41.6.0 
 C:\Python27\python.exe setup.py install 
 </pre> 

 * If you get error complaining pythonpath syntax error from leginon setup, disable that environment variable byt changing its variable name for now.* 

 h3. Install wheel 

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

 h3. Install pip 

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

 h2. 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 
 <pre> 
 C:\Python27\Scripts\pip.exe install D:\PyMySQL-0.10.1-py2.py3-none-any.whl 
 </pre> 

 h2. testing 

 Start python command line interface and import pymysql