使用Python设置Gurobi

2024-04-23 19:43:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在Python中使用Gurobi。作为一个IDE,我使用PyCharm。当我使用安装gurobipyPyCharm时,我收到以下错误

enter image description here

我还尝试通过Anaconda安装库,如this link所示。但是,我收到另一个错误,如下所示

(base) C:\Users\...>conda install -c gurobi gurobi
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - gurobi -> python[version='2.7.*|3.5.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|3.4.*']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your CUDA driver:

  - feature:/win-64::__cuda==11.0=0
  - feature:|@/win-64::__cuda==11.0=0

Your installed CUDA driver is: 11.0

我有Gurobi 9.0.2的学术版本,并在Windows 10中使用Python 3.8.3。我想知道如何解决这个问题


Tags: thetojsonforyourthatenvironmentversion