Setting up gurobipy in Spyder: ModuleNotFoundError: No module named 'gurobipy'

Comments

4 comments

  • Matthias Miltenberger

    Hi Michael,

    You need to have Gurobipy installed in the same environment that Spyder is using. Please have a look at this guide and try executing the commands in step 2 withing Spyder. This will install Gurobi to the Spyder environment.

    Best regards,
    Matthias

    0
    Comment actions Permalink
  • Behrooz Pourghannad

    Hi Matthias,

    I have exactly the same problem. I followed the steps you mentioned (in the link). Still I get the same result. 

    On executing the command, I get the following, I am not sure what to do.

    Error processing line 7 of C:\Users\Behrooz\Anaconda3\lib\site-packages\pywin32.pth:

    Traceback (most recent call last):
    File "C:\Users\Behrooz\Anaconda3\lib\site.py", line 168, in addpackage
    exec(line)
    File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'pywin32_bootstrap'

    Remainder of file ignored

    Building graph of deps: 0%| | 0/2 [00:00<?, ?it/s]
    Examining gurobi: 0%| | 0/2 [00:00<?, ?it/s]
    Examining python=3.7: 50%|##### | 1/2 [00:00<00:00, 45.48it/s]

    Determining conflicts: 0%| | 0/2 [00:00<?, ?it/s]
    Examining conflict for gurobi python: 0%| | 0/2 [00:00<?, ?it/s]

    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']

    Your python: python=3.7

    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.

    0
    Comment actions Permalink
  • Matthias Miltenberger

    Hi,

    Can you please have a look at this SO post? Please try running

    pip install pywin32

    or

    conda install pywin32

    Cheers,
    Matthias

    0
    Comment actions Permalink
  • Behrooz Pourghannad

    Hi Matthias,

    I followed your suggestion, it still does not work. 

    pywin32 is already installed:

    and the channel is established:

    But still I get:

    Any other step I need to go through?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk