Oemof install issues - WinPython

Hey together,
i’m new at oemof and tried to install it under windows 10 with WinPython, version 3.8.5.
I followed the YouTube Tutorial from the oemof-homepage step-by-step.
Installing WinPython itself shouldn’t be the problem, but after typing “pip install oemof” in the Command Prompt the following errors appeared (Errors: last 7 Rows of following block):

C:\Users\tlabr\Python\WPy64-3850\scripts>pip install oemof
Collecting oemof
Using cached oemof-0.3.2-py3-none-any.whl (75 kB)
Collecting numpy<1.18,>=1.7.0
Downloading numpy-1.17.5-cp38-cp38-win_amd64.whl (12.7 MB)
|████████████████████████████████| 12.7 MB 6.4 MB/s
Collecting pandas<0.26,>=0.18.0
Downloading pandas-0.25.3-cp38-cp38-win_amd64.whl (9.4 MB)
|████████████████████████████████| 9.4 MB 3.3 MB/s
Collecting pyomo<5.7,>=4.4.0
Using cached Pyomo-5.6.9-py2.py3-none-any.whl (2.5 MB)
Requirement already satisfied: networkx<3.0 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from oemof) (2.4)
Requirement already satisfied: blinker<2.0 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from oemof) (1.4)
Collecting dill<0.4
Using cached dill-0.3.2.zip (177 kB)
Requirement already satisfied: pytz>=2017.2 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pandas<0.26,>=0.18.0->oemof) (2020.1)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pandas<0.26,>=0.18.0->oemof) (2.8.1)
Collecting PyUtilib>=5.8.0
Using cached PyUtilib-6.0.0-py2.py3-none-any.whl (254 kB)
Requirement already satisfied: ply in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pyomo<5.7,>=4.4.0->oemof) (3.11)
Requirement already satisfied: appdirs in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pyomo<5.7,>=4.4.0->oemof) (1.4.4)
Requirement already satisfied: six>=1.4 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pyomo<5.7,>=4.4.0->oemof) (1.15.0)
Requirement already satisfied: decorator>=4.3.0 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from networkx<3.0->oemof) (4.4.2)
Collecting nose
Using cached nose-1.3.7-py3-none-any.whl (154 kB)
Building wheels for collected packages: dill
Building wheel for dill (setup.py) … done
Created wheel for dill: filename=dill-0.3.2-py3-none-any.whl size=78976 sha256=d1466f8cacea66d6a592c34b5de09d4a00c08f2acbf0468f535b5086fb3506ff
Stored in directory: c:\users\tlabr\appdata\local\pip\cache\wheels\93\7f\7d\78ec535a4340ef2696aad8b17fe8bb063d56301bd62881b069
Successfully built dill
Installing collected packages: numpy, pandas, nose, PyUtilib, pyomo, dill, oemof
Attempting uninstall: numpy
Found existing installation: numpy 1.19.1+mkl
Uninstalling numpy-1.19.1+mkl:
Successfully uninstalled numpy-1.19.1+mkl
Attempting uninstall: pandas
Found existing installation: pandas 1.1.0
Uninstalling pandas-1.1.0:
Successfully uninstalled pandas-1.1.0
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

vega 3.4.0 requires pandas<2.0.0,>=1.0.0, but you'll have pandas 0.25.3 which is incompatible.
plotnine 0.7.1 requires pandas>=1.1.0, but you'll have pandas 0.25.3 which is incompatible.
mizani 0.7.1 requires pandas>=1.0.0, but you'll have pandas 0.25.3 which is incompatible.
Successfully installed PyUtilib-6.0.0 dill-0.3.2 nose-1.3.7 numpy-1.17.5 oemof-0.3.2 pandas-0.25.3 pyomo-5.6.9

After that I first tried to upgrade pandas, so 1.1.1 got installed - but the following error appeared:

C:\Users\tlabr\Python\WPy64-3850\scripts>pip install pandas --upgrade
Collecting pandas
  Downloading pandas-1.1.1-cp38-cp38-win_amd64.whl (9.6 MB)
 |████████████████████████████████| 9.6 MB 147 kB/s
Requirement already satisfied, skipping upgrade: pytz>=2017.2 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pandas) (2020.1)
Requirement already satisfied, skipping upgrade: numpy>=1.15.4 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pandas) (1.17.5)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.7.3 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from pandas) (2.8.1)
Requirement already satisfied, skipping upgrade: six>=1.5 in c:\users\tlabr\python\wpy64-3850\python-3.8.5.amd64\lib\site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Installing collected packages: pandas
  Attempting uninstall: pandas
    Found existing installation: pandas 0.25.3
    Uninstalling pandas-0.25.3:
      Successfully uninstalled pandas-0.25.3
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

oemof 0.3.2 requires pandas<0.26,>=0.18.0, but you'll have pandas 1.1.1 which is incompatible.
Successfully installed pandas-1.1.1

Oemof itself cant work with the upgraded pandas, so I downgraded pandas back to 0.25.3.

After that, I installed the CBC-Solver for Win64 and addet it to “PATH” at the advanced system-setting.
After restart, I tried running “oemof_installation_test”, but it doesn’t show the right result, the following errors appeared:

C:\Users\tlabr\Python\WPy64-3850\scripts>oemof_installation_test
Traceback (most recent call last):
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\Scripts\oemof_installation_test.exe\__main__.py", line 4, in <module>
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\oemof\tools\console_scripts.py", line 19, in <module>
    from oemof import solph
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\oemof\solph\__init__.py", line 1, in <module>
    from oemof.solph.network import (Sink, Source, Transformer, Bus, Flow,
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\oemof\solph\network.py", line 20, in <module>
    from oemof.solph import blocks
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\oemof\solph\blocks.py", line 13, in <module>
    from pyomo.core import (Var, Set, Constraint, BuildAction, Expression,
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\pyomo\core\__init__.py", line 11, in <module>
    from pyomo.core.expr import *
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\pyomo\core\expr\__init__.py", line 36, in <module>
    from .calculus.derivatives import differentiate
  File "C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\pyomo\core\expr\calculus\derivatives.py", line 3, in <module>
    from pyutilib.enum import Enum
ImportError: cannot import name 'Enum' from 'pyutilib.enum' (C:\Users\tlabr\Python\WPy64-3850\python-3.8.5.amd64\lib\site-packages\pyutilib\enum\__init__.py)

It seems like Enum isn’t installed, but the folder “enum” ist downloaded with the files "init and “init.cpython-38”.

Now I have no idea, how to get oemof running.
Could anyone please help me?

Hi @TLab

I would try running some basic standalone enum examples from the enum documentation. That might perhaps isolate the problem?

And I would try the following variants as well to see what you can learn:

import enum    # usual
import Enum    # a bit odd and perhaps some other module?

HTH, R.

@TLab, welcome to the openmod forum.

I think there are two ways to solve your problem.

  1. Upgrade to the latest version of oemof solph using:
    pip install oemof.solph --upgrade. The latest version of solph will work with the latest version of pyomo and pandas.
  2. Create a virtual environment only for solph to avoid problems with other packages. If you want to use solph < v0.4.0 you have to install it using:
    pip install oemof. After that you have to downgrade pandas to 0.25 and pyomo to 5.6.9. I am not sure with the pyomo version, you may have to downgrade pyomo step by step until it works.

Hi @uwe.krien,
I tried your first solution, installed oemof.solph and tested “oemof_installation_test” again. It works and shows the expected results.

*****************************
Solver installed with oemof:

cbc: working
glpk: not working
gurobi: not working
cplex: not working

*****************************
oemof successfully installed.
*****************************

Now, I can start the first small modelling step by step, thank you very much :slight_smile:

Text and images licensed under CC BY 4.0Data licensed under CC0 1.0Code licensed under MITSite terms of serviceOpenmod mailing list.