Skip to content

Commit 2bc4a90

Browse files
author
Lachlan Perrier
committed
update install instructions
1 parent 21a1032 commit 2bc4a90

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

README.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,46 @@ A python package to run the San Francisco Bay Area's Travel Model.
1212

1313
## Installation
1414

15-
Recommended install in a virtual environment.
15+
It is recommended that tm2install in a virtual environment.
1616

1717
Stable (to come - use bleeding edge for now):
18-
1918
```bash
2019
pip install tm2py
2120
```
2221

23-
Bleeding edge:
24-
TODO: Which environment is this? Does it still work for anyone?
22+
For Developers, it is recomended that the following instructions are used to install
23+
*Note: The Python Environment has recently been updated to python 3.11, there may be some instabilites with current build*
24+
```bat
25+
git clone --branch develop https://github.com/BayAreaMetro/tm2py.git
2526
26-
```bash
27-
conda env create -f environment.yml
27+
conda create -n tm2py python=3.11.9
2828
conda activate tm2py
29-
pip install git+https://github.com/bayareametro/tm2py@develop
30-
```
31-
32-
The above directions didn't work for the MTC Windows environment. The following method did work, on a machine with Emme-4.6.0 installed. This required a compiled GDAL/Fiona package set for python 3.7, this can be found in the [lib directory](/lib/) , consisting of the following:
33-
34-
1. GDAL-3.3.2-cp37-cp37m-win_amd64.whl
35-
2. pyproj-3.2.1-cp37-cp37m-win_amd64.whl
36-
3. Fiona-1.8.20-cp37-cp37m-win_amd64.whl
37-
4. Shapely-1.8.1-cp37-cp37m-win_amd64.whl
38-
5. geopandas-0.10.2-py2.py3-none-any.whl
39-
40-
With these files in hand, the following installation instructions work:
29+
conda install gdal
30+
conda install pyproj
31+
conda install fiona
32+
conda install shapely
33+
conda install geopandas
4134
42-
```bat
43-
conda create -n tm2py python=3.7.6
44-
conda activate tm2py
45-
pip install [the packages listed above, in that order]
4635
cd <path to tm2py git directory>
36+
git
4737
pip install -e .
4838
conda env config vars set GDAL_VERSION=3.3.2
4939
```
5040
Finally, install the Emme python packages using the Emme GUI. This effectively creates a file,
5141
`C:\Users\%USERNAME%\.conda\envs\tm2py\Lib\site-packages\emme.pth` with the following contents, so you could create the file yourself.
5242

5343
```python
54-
import os, site; site.addsitedir("C:/Program Files/INRO/Emme/Emme 4/Emme-4.6.0/Python37/Lib/site-packages")
44+
import os, site; site.addsitedir(os.path.join(os.environ["EMMEPATH"], "Python311/Lib/site-packages"))
45+
```
46+
47+
*This should start Emme OpenPath, if it does not you should be able to manually set the correct version of emme such as below*
48+
```python
49+
import os, site
50+
os.environ["EMMEPATH"] = r"C:\Program Files\Bentley\OpenPaths\EMME 24.00.00"
51+
site.addsitedir(os.path.join(os.environ["EMMEPATH"], "Python311/Lib/site-packages"))
5552
```
5653

54+
5755
In troubleshooting, sometimes DLL load failure errors would occur which may be resolved by importing gdal before importing emme packages. Emme support explained this thusly:
5856

5957
At load time, the EMME API will always load the geos_c co-located with the EMME API, unless it was already loaded from some other location, which is the case when you import GDAL first. EMME API seems to be compatible with the newer GDAL/geos_c (reminder: not tested!). But this does not appear to be the case the other way around (newer GDAL is not compatible with older geos_c).

0 commit comments

Comments
 (0)