Problem with conda installation

oemof

#1

Hi everyone,

I am having some problems trying to install oemof with Anaconda on Windows. After the collection of pandas, it returns this:

 Complete output from command python setup.py egg_info:
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable g95
Could not locate executable efort
Could not locate executable efc
don't know how to compile Fortran code on platform 'nt'
non-existing path in 'numpy\\distutils': 'site.cfg'

then many lines of warnings, expections and errors, ending with this:

Command “python setup.py egg_info” failed with error code 1 in C:\Users\Lombardi\AppData\Local\Temp\pip-build-fxbnujoj\pandas\

Any ideas of what’s the problem? Thanks a lot,

Francesco Lombardi


#2

As it does not seem to be an oemof issue you may have a better chance to use google or post the problem in stackoverflow.com.

Anyway, you could try to update PyPi before installing oemof

pip install --upgrade pip

You could also check out if you have installed the right Anaconda version. I successfully installed oemof using WinPython. You could try this if nothing else helps.


#3

Haven’t seen the problem before. Would you like to explain what you have done step by step? Is the problem occurring before you even get to the point where you install oemof?


#4

Thanks for the replies. Pip is updated, and it usually works for installing other packages. I already have in my environment most of the needed libraries (numpy, scipy, pandas, pyomo etc.), as well as the solvers. So I just followed the procedure that I found on readthedocs for installing Oemof with Anaconda, exactly those steps. It starts collecting some packages (that I already have) and then provides that long list of errors. Maybe that’s the problem? that I already have the packages it wants to install? I don’t think that should be a problem.


#5

That can’t be the problem. Do you use an virtual environment? If not you should do that with Anaconda as well as with WinPython.

oemof needs the follwing packages:

  • dill
  • numpy >= 1.7.0
  • pandas >= 0.18.0’
  • pyomo >= 4.2.0, != 4.3.11377’
  • networkx

First totally clean your virtual environment. Try to install all the packages above manually with pip install packagename and check it afterwards with pip list.

Then install oemof with pip install oemof and post the full error message - if there is still an error.


#6

Ok thanks, I’ll try this way to see if one of the packages creates problem, but in the while…
I was working on my second PC (still Windows) which only has the basic Python 3.6 version installed, and I tried to install oemof on that: it worked without problems! So, I tried today on my office-PC that was having problems to install oemof on a Conda virtual environment based on Py 3.6 (instead of the suggested 3.4) and, again, it worked! No errors and installation completed. Nonetheless, if I try to run “oemof_installation_test” it returns:

Traceback (most recent call last):
File “d:\ananconda\envs\oemofenv\lib\runpy.py”, line 193, in _run_module_as_main
"main", mod_spec)
File “d:\ananconda\envs\oemofenv\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "D:\Ananconda\envs\OemofEnv\Scripts\oemof_installation_test.exe_main
.py", line 5, in
ModuleNotFoundError: No module named ‘tests’


#7

I hope it wasn’t me who suggested 3.4 :wink: Oemof is tested on 3.4/3.5/3.6 but should work on 3.x. Once Python 3.7 is released we will test on 3.7 as well. So from our point of view you are free to choose your favoured version but we suggest to use one of the tested versions.

Sorry, this is a known issue and I will try to repair it with v0.2.1. See the release note.

You could mark your post above as solution because it describes your solution. So that this thread will be marked as solved.


#8

Ok, great! Regarding the version, 3.4 is suggested on Readthedocs (section Installation on Windows), that’s why I was trying to install on that one. I would suggest to update the documentation based on this topic :slight_smile: Best


#9

Thank you, I will change that. It will be fixed with v0.2.1.


#10

Hi everyone

I use this topic not to generate a new but similar one.
I installed oemof in a new pc using Anaconda (in my previous one I could make it working) but I find a new key error.
I think oemof be correctly installed, as trying to run the simple dispatch example I obtain this:

n [3]: runfile(‘C:/Users/Gabriele/oemof/oemof_examples-master/examples/oemof_0.1/simple_dispatch/simple_dispatch.py’, wdir=‘C:/Users/Gabriele/oemof/oemof_examples-master/examples/oemof_0.1/simple_dispatch’)
11:50:23-INFO-Path for logging: C:\Users\Gabriele.oemof\log_files
11:50:23-INFO-Used oemof version: 0.1.4
11:50:23-INFO-Creating objects
11:50:23-INFO-Create optimization problem
Traceback (most recent call last):

but then it returns:

File “C:\Users\Gabriele\AppData\Local\Continuum\envs\oemof\lib\site-packages\pyomo\core\base\indexed_component.py”, line 695, in _validate_index
% ( idx, self.name, ))

KeyError: “Index ‘(<oemof.solph.network.Bus object at 0x0000025D293963A8>, 0)’ is not valid for indexed component ‘Bus.balance’”

and I have no idea how to solve it.
Could you kindly help me?

Thanks a lot
Gabriele


#11

Hi Gabriele,

it looks like it is also related to the changed pyomo API.

Can you tell us which pyomo-version you are using (by using the command “conda list”)?

Cheers
Cord


#12

If you are using a pyomo version > 5.4.1 try to install the latest working version using “pip install ‘pyomo==5.3’”.

The developers have introduced some internal checkups for certain data types in versions > 5.4 which needs another way to build the constraints (which will be firstly integrated in oemof v0.2.1).

In future versions, we will deal with this problem by tying each oemof release to a fix tested pyomo version (range) so the error cannot come up by automatically installing the newest pyomo version using the oemof pip-installer.

Cheers
Cord


#13

…and it worked!
Thank you Cord, indeed I had pyomo 5.4.3 installed

gabriele


#14

Hi again!

Using oemof 0.1.4 I ran a csv reader dispatch script I used with a previous version. It works correctly but it has problems when plotting.
Here what it returns:
10:49:35-INFO-Path for logging: C:\Users\Gabriele.oemof\log_files
10:49:35-INFO-Used oemof version: 0.1.4
10:49:35-INFO-Starting optimization
10:49:37-INFO-Done!
10:49:38-INFO-The results can be found in C:\Users\Gabriele\csv_dispatch
10:49:38-INFO-Read the documentation (outputlib) to learn how to process the results.
10:49:38-INFO-Showing plots
Traceback (most recent call last):

File “C:\Users\Gabriele\AppData\Local\Continuum\envs\oemof\lib\site-packages\pandas\core\indexing.py”, line 1269, in _convert_to_indexer
.format(mask=objarr[mask]))

KeyError: “[‘IT_CHP_natgas’ ‘IT_boiler_th_ind’] not in index”

is it maybe another update issue related to outputlib?

thanks
gabriele


#15
  1. I do not think that it has something to do with the conda installation so you should open a new topic.

  2. The error message you copied into the code is the KeyError raised by the pandas package. It shows, that the key is not found but does not give any further information to find out why this happened. Please check the name of the key (including the case). Either the Flow is not present at all or it is named differently.


#16

Thank you Uwe

I realized that probably the problem is related to how I defined the component Transformer in the csv. The names of the keys are correct, but probably I modelled the components in a wrong way. I will open a new topic.

Gabriele