PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
153 stars 40 forks source link

Licensed CPLEX not detected #263

Open RobinsonBeaucour opened 3 months ago

RobinsonBeaucour commented 3 months ago

Describe the Bug

Hello, I am trying to use PyPSA with CPLEX to model an energy system but it does not find my licenced CPLEX:

CPLEX Error  1016: Community Edition. Problem size limits exceeded.

I have installed the following package in my 3.10 python venv :

cplex
pandas
pypsa
plotly

leading to this environment :

attrs==23.2.0
blosc2==2.5.1
Bottleneck==1.3.8
certifi==2024.2.2
cftime==1.6.3
click==8.1.7
click-plugins==1.1.1
cligj==0.7.2
cloudpickle==3.0.0
colorama==0.4.6
contourpy==1.2.0
cplex==22.1.1.0
cycler==0.12.1
dask==2024.3.1
deprecation==2.1.0
fiona==1.9.6
fonttools==4.50.0
fsspec==2024.3.1
geopandas==0.14.3
importlib_metadata==7.1.0
kiwisolver==1.4.5
linopy==0.3.8
locket==1.0.0
matplotlib==3.8.3
msgpack==1.0.8
ndindex==1.8
netCDF4==1.6.5
networkx==3.2.1
numexpr==2.9.0
numpy==1.26.4
packaging==24.0
pandas==2.2.1
partd==1.4.1
pillow==10.2.0
plotly==5.20.0
ply==3.11
py-cpuinfo==9.0.0
Pyomo==6.6.1
pyparsing==3.1.2
pyproj==3.6.1
pypsa==0.27.1
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.1
scipy==1.12.0
shapely==2.0.3
six==1.16.0
tables==3.9.2
tenacity==8.2.3
toolz==0.12.1
tqdm==4.66.2
tzdata==2024.1
validators==0.24.0
xarray==2024.2.0
zipp==3.18.1

I wanted to simulate the energy system on 8760h but I can't. Nevertheless I can simulate on 24 hours using the free CPLEX version provided by cplex python package.

I looked for similar issues but I found nothing. Any idea ?

PS :

RobinsonBeaucour commented 2 months ago

I think the problem is that linopy tried to use cplex instead of docplex. But docplex have replace cplex for a while. For now linopy does not work with CPLEX.

fneum commented 2 months ago

No CPLEX user here, but what is the difference between cplex and docplex pip packages? Both still seem to be updated. Could you point us to a link?

RobinsonBeaucour commented 2 months ago

I understand. I am trying to use it as a side project. I will try to answer your question soon and test other solution. Hope to find a working solution !