USEPA / ElectricityLCI

Creative Commons Zero v1.0 Universal
24 stars 10 forks source link

Use of main with pip install #101

Closed WesIngwersen closed 4 years ago

WesIngwersen commented 4 years ago

The recommended install method and organization of the module to run from main.py is not compatible unless I'm missing something. If you install via the method in the Wiki it will install it on your python version site packages like installing python packages from Pypi. The problem is that then the user won't be working in those module directories like when working from a github pull.thks means at least for me

import electricitylci electricitylci.main() Or electricitylci.main.main()

Do not work and I don't know another way to run main within another python script and I also don't think you can run

python electricitylci.main() Or something like that from the terminal either

WesIngwersen commented 4 years ago

An easy fix to this I think would be to add a main() to the init that just calls main.main() but not sure how pythonic that is

m-jamieson commented 4 years ago

I was running it using this before, which I recognize is not advisable: python C:\Users\jamiesom\AppData\Roaming\Python\Python37\site-packages\electricitylci\main.py

It appears that this should work - I got the configuration selector to come up anyways. python -m electricitylci.main When I actually tried to run it I was still getting the error for the missing chemicalmatcher/config.yaml. Reinstalling using pip and trying again.

WesIngwersen commented 4 years ago

@jump2conclusionsmatt Erasing text of last point. Yes the config.yaml fix should have been done. You need to pip uninstall StEWI before doing this to uninstall your old version

m-jamieson commented 4 years ago

running python -m electricitylci.main worked for me after copying in the config.yaml. Oh my bad about the issue I just opened then. I know you mentioned requiring the newest release of Stewi, I just assumed that was actually 0.9.2...not that 0.9.3 or whatever needed to be created.

WesIngwersen commented 4 years ago

It is v0.9.2 that should work fine

m-jamieson commented 4 years ago

It didn't for me. I got this after installing electricitylci: Successfully installed StEWI-0.9.2... and still ended up with the config.yaml error.

WesIngwersen commented 4 years ago

@jump2conclusionsmatt ok i also confirm that python -m electricitylci.main is running for me..its downloading original EIA-923 files now..i will repost if there are any issues I'm seeing a few weird comments i might remove like Loading data from previously downloaded excel file, how did the csv file get deleted? i will post if i encounter errors but otherwise the run of main.py from the python is fine for me..i will update the wiki and we can comment about remaining install dependency issues in the pull request