Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo pip3 install oemof, import oemof not working #44

Closed
eosram opened this issue Jan 6, 2016 · 11 comments
Closed

sudo pip3 install oemof, import oemof not working #44

eosram opened this issue Jan 6, 2016 · 11 comments

Comments

@eosram
Copy link

eosram commented Jan 6, 2016

Tried to install oemof with "sudo pip3 install oemof". Everything seems to work fine, no errors, but import oemof in python got me a "no module named oemof" error. Downloading the zipped package and installing with "pip3 -e /path" worked fine, import oemof also. Do I have to adjust some environment variables when installing otherwise?

@eosram
Copy link
Author

eosram commented Jan 6, 2016

The command was actually "sudo pip3 install oemof_base", forgot the underscore base. Importing the module in python still failed.

@eosram eosram closed this as completed Jan 6, 2016
@eosram eosram reopened this Jan 6, 2016
@uvchik
Copy link
Member

uvchik commented Jan 6, 2016

This is confusing. Maybe we should change this.

The name of the package on github or pypi is oemof_base but is installed as oemof. Have a look at the storage_invest example. There you can see how imports work.

from oemof.core import energy_system as es

Try the example but change line 147 if you do not have Gurobi installed.

For testing purpose you could install the glpk solver: https://www.gnu.org/software/glpk/

solver='glpk'

Does the example works for you?

@eosram
Copy link
Author

eosram commented Jan 6, 2016

The import of oemof in python worked fine when installing with 'sudo pip3 install -e /path/oemof_base-dev' (downloaded from github), also storage_invest.py runs without problems (thanks for the hint to use the 'glpk' solver). Just the import of oemof in python after installing it with 'sudo pip3 install oemof-base' as stated in the docs resulted in the missing module error.

@uvchik
Copy link
Member

uvchik commented Jan 6, 2016

As it works for you it is not urgent, right?

  • What happens if you import oemof_base?
  • What is the output of pip3 list (not whole list, but the oemof specific part)?

@ulfmueller Do you had the same problems lately? (#38)
@gnn Do you have an idea?

@ulfmueller
Copy link

yes I had the exact same problem and I performed the same work around as @S3PP ....

@eosram
Copy link
Author

eosram commented Jan 6, 2016

No, its not urgent, I was just wondering!
retrieved with pypi:

pip3 list | grep oemof
oemof-base (0.0.2.1)

...import oemof or import oemof_base in python fails.

@uvchik
Copy link
Member

uvchik commented Jan 6, 2016

Thank you for the report @S3PP, we will try to fix it.

@uvchik
Copy link
Member

uvchik commented Jan 7, 2016

I found out that import oemof_base.oemof works.

@gnn : Don't you think it is the same problem we had when we used the src folder?

I opened a new issue (#45) to discuss the renaming of the folder to avoid such errors.

@nesnoj
Copy link
Member

nesnoj commented Jan 8, 2016

same problem here when using 'sudo pip3 install oemof-base', gonna use workaround too.
BTW: When listing '/usr/local/lib/python3.4/dist-packages/' there's only the egg-dir of oemof, no package dir named 'oemof' nor 'oemof_base'

gnn added a commit that referenced this issue Jan 22, 2016
@gnn
Copy link
Member

gnn commented Jan 22, 2016

The problem is different to the one that occured when we where using src as the source folder.
I was able to reproduce the current issue though when trying to install from a local source distribution generated via python setup.py sdist.
Commit 4a371d7 fixed it for me
@uvchik: Could you check whether it also works locally for you? If so we could upload a 0.0.2.2 version (now that we have a fourth version number anyway) and see whether that fixes things for everybody else too.

Edit: What I did technically fixes the issue, but sub-packages where still not importable. Commit 4290533 should complete the fix.

gnn added a commit that referenced this issue Jan 22, 2016
The previous fix left sub-packages like e.g. `oemof.core` still
unimportable. This should be resolved now.
Hope I've learned my lesson and will start a new branch for all changes.
@uvchik
Copy link
Member

uvchik commented Jan 25, 2016

I tested it, uploaded the version 0.0.2.2 and tested the uploaded version. Works now. Thank you 😄

@uvchik uvchik closed this as completed Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants