USEPA / SWMM-EPANET_User_Interface

User interface for the Stormwater-Management-Model
111 stars 67 forks source link

Getting Started as a Developer in Python 3 - whl problem #289

Closed michelleannesimon closed 5 years ago

michelleannesimon commented 5 years ago

On 11/07/2018, we went to https://www.qgis.org/en/site/forusers/download to get the most recent version of OSGeo4W (64 bit) 3.4.1.1 (dated 11/3/2018) and we discovered that it uses Python 3.7 (not 3.6) and so the whl command recommended in the wiki did not work. Please see below:

import pip
def install_whl(path):
    pip.main(['install', path])

wpath = "C:/path/to/whl/file/swmm_output-0.2.0.dev0-cp36-cp36m-win_amd64.whl"
install_whl(wpath)

We went to http://download.osgeo.org/qgis/win64/ and downloaded QGIS_OSGeo4W (64 bit) and got version 3.0.3.1 (dated 5/20/2018) because it contained Python 3.6.5, as it was in the readme file https://github.com/USEPA/SWMM-EPANET_User_Interface/blob/dev-ui-py3qt5/README.md . We had to change some of the paths for the environmental variables but eventually were successful installing the whl via this commandpython3 -m pip install --user swmm_output-0.2.0.dev0-cp36-cp36m-win_amd64.whl

Yust11135 commented 5 years ago

Two or three weeks ago everything was fine. About 10 days ago I Installed in my new laptop OSGeo4W64 and find python37 directory. After that I back to my old laptop and download all packages with python 3.6. I don’t have enough time to check my “offline” installation with python 3.6. If my “offline” packages will be work I can upload it to github and share it.

ehsanMa86 commented 5 years ago

@michelleannesimon At this moment I am unable to test this idea on my workstation since I don't have the right to install a software on university machine, but I guess when you are installing the QGIS from OSGeo4w, you can click on advance installation and downgrade the python-core version to 3.6 . It might work for now.

michelleannesimon commented 5 years ago

Let's pick a version of QGIS and Python, document it in Wiki, and resolve all other issues with this version before changing.

michaeltryby commented 5 years ago

I built new swmm-python wheels for Python 3.6 and 3.7. You can find them here.

michelleannesimon commented 5 years ago

Thanks. I will check it out.

Sent from my iPhone

On Feb 15, 2019, at 1:39 PM, Michael Tryby notifications@github.com<mailto:notifications@github.com> wrote:

I built new swmm-python wheels for Python 3.6 and 3.7. You can find them herehttps://github.com/OpenWaterAnalytics/swmm-python/releases/tag/v0.3.0-dev.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/USEPA/SWMM-EPANET_User_Interface/issues/289#issuecomment-464154764, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AY6cFNReYF76qAaV-y9AmoPzi-iMpYU_ks5vNv7rgaJpZM4YVS6E.

michaeltryby commented 5 years ago

I updated the new epanet-python wheels for Python 3.6 and 3.7 as well. You can find them here.

PaulDudaRESPEC commented 5 years ago

@michelleannesimon, I think this issue can be closed now, as Michael's swmm-python wheel for Python 3.7 worked for me, and I've updated the wiki instructions accordingly.

TongZhai commented 5 years ago

@michaeltryby I just installed the latest swmm.output whl (swmm.output-0.4.0.dev0-cp37-cp37m-win_amd64.whl), it install correctly, but failed at runtime. It is missing the SMO_sys enum type, I saw SMO_link, SMO_node, and SMO_subcatch, but didn't see SMO_sys type.

TongZhai commented 5 years ago

@michaeltryby I am able to run EPANET model (Net1.inp) using the current output api on the new python3.7 stack, so I suppose we are to update that to use the new whl file going forward?

michaeltryby commented 5 years ago

@TongZhai Yes that is correct. Going forward please use the epanet-python and swmm-python wheels.

If you could also open up an issue about the problem you had with swmm.output over in the swmm-python repo that would be great! Thanks! :smile:

TongZhai commented 5 years ago

@michaeltryby just opened a new issue 32 on swmm-python repo

TongZhai commented 5 years ago

@michaeltryby just opened a new issue 44 on epanet-python repo about the compatibility issue with the current epanet output api dll

michaeltryby commented 5 years ago

@TongZhai Thanks for creating these issues.

The swmm and epanet dlls have been wrapped in python using SWIG and packaged into wheels for your convenience. The swig wrapped dlls are significantly faster than the ctypes wrapped dlls you are currently using. The epanet and swmm python modules also handle exceptions and some metadata, allowing you to deprecate corresponding code in the UI project.

PaulDudaRESPEC commented 5 years ago

With the newly committed SMOutputSWIG.py and the fix to [https://github.com/OpenWaterAnalytics/swmm-python/issues/32], the SWMM output is reading properly.