-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBuildStandAlonePython.txt
90 lines (62 loc) · 3.17 KB
/
BuildStandAlonePython.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Building the standalone python virtual environment
Mac OS
1) Get Python source
2) In Modules/Setup.dist Search for “SSL” and uncomment the code as shown below
_socket socketmodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
3) Set the SSL=to the path to ssl in cellar or wherever on your system
4) cd the source folder and run ./configure --enable-optimizations --prefix=/Users/steve/Desktop/PythonEnv -> make sure that the prefix is an accessible place where you want to build the virtual env.
5) Run make
6) Run make install
7) Use dylib bundler to bundle deps with the python
/usr/local/Cellar/dylibbundler/0.4.5/bin/dylibbundler -od -b -p @loader_path/ -x /Users/steve/Desktop/PythonENV/bin/python3.8 -d /Users/steve/Desktop/PythonENV/bin/libs
8) It will save the deps to the lib folder. Copy and past them back to the bin folder and delete the libs folder.
9) Rename python3 to python
10) Run the SSLScript.py file in the repo, in admin cmd to configure the SSL.
11) Run the below in pip
Note that the newer GDAL does not work with Fiona, had to use the older 3.1.4 version
pip install wheel jpype1 - please first install this package first; incompatibility was observed when trying to install this package after the rest
pip install SciPy pandas shapely GDAL==3.1.4 fiona pyproj six rtree geopandas rasterio
Or
pip install wheel
pip install SciPy
pip install pandas
pip install shapely
pip install GDAL==3.1.4
pip install fiona
pip install pyproj
pip install six
pip install rtree
pip install geopandas
pip install rasterio
Windows
To build Python from source:
1) Get Python source, download from: https://github.com/python/cpython on the pulldown select the version of Python that you will be building, e.g., 3.8, and click on code and download a zip.
2) Cd the folder PCbuild in the source folder
3) Run the command: build.bat --pgo -p x64
4) Open the pcbuild.sln file in VS2017-19 in the PCbuild folder
5) Under the menu Project->Properties, in the dropdown Configuration set to All Configurations and in the dropdown Platform set to All Platforms. Then click on General in the left pane and set the Output directory to the directory where Python will be built.
6) Set to release and x64 and build
4) Run the below in pip
Note that the newer GDAL does not work with Fiona, had to use the older 3.1.4 version
Install the following dependencies thourgh pip in this exact order:
pip install wheel
pip install jpype1 - please first install this package first; incompatibility was observed when trying to install this package after the rest
pip install SciPy
pip install pipwin
pipwin install pandas
pipwin install shapely
pipwin install GDAL==3.1.4
pipwin install fiona
pipwin install pyproj
pipwin install six
pipwin install rtree
pipwin install geopandas
pipwin install rasterio
To deploy run on the exe in the build folder:
C:\Qt\5.15.1\msvc2019_64\bin\windeployqt.exe C:\Users\Office\Desktop\SimCenter\OpenSRA\build-OpenSRA-Desktop_Qt_5_15_1_MSVC2019_64bit-Release\release\OpenSRA.exe