Project

General

Profile

Install pymysql on Windows PC » History » Version 1

Anchi Cheng, 12/09/2021 05:20 PM

1 1 Anchi Cheng
h1. Install pymysql on Windows PC
2
3
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.
4
5
h2. Downloads
6
7
|package|version that works for python2.7|File available at this site for convenience|
8
|setuptools|41.6.0|setuptools-41.6.0.zip|
9
|wheel|0.36.2|wheel-0.36.2.tar.gz|
10
|pip|20.3.4|pip-20.3.4.tar.gz|
11
|pymysql|1.0.2|PyMySQL-0.10.1-py2.py3-none-any.whl|
12
13
*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*
14
15
h2. Install pip
16
17
We will install the two dependencies setuptools and wheel before installing pip
18
19
h3. install setuptools
20
21
Let's say the uncompressed folder is D:\setuptools-41.6.0
22
23
1. Open Windows power shell or other commandline tool.
24
25
<pre>
26
cd D:\setuptools-41.6.0
27
C:\Python27\python.exe setup.py install
28
</pre>
29
30
* If you get error complaining pythonpath syntax error from leginon setup, disable that environment variable byt changing its variable name for now.*
31
32
h3. Install wheel
33
34
Same procedure as above but first change directory to be inside the uncompressed wheel-0.36.2 folder
35
36
h3. Install pip
37
38
Same procedure as above but first change directory to be inside the uncompressed pip-20.3.4 folder
39
40
h2. install pymysql with pip
41
42
Let's say that the wheel file for pymysql is at D:\PyMySQL-0.10.1-py2.py3-none-any.whl
43
In the Windows power shell
44
<pre>
45
C:\Python27\Scripts\pip.exe install D:\PyMySQL-0.10.1-py2.py3-none-any.whl
46
</pre>
47
48
h2. testing
49
50
Start python command line interface and import pymysql