Python 3.8 and dlib error on macOS
OngoingHi everyone, cheers!
I just installed the Gurobi 9.0.3 in my macOS system. I also never had any problem with the installation or with the usage.
Nevertheless, this time I am getting a strange error while importing the gurobipy library:
Traceback (most recent call last):
File "./mdvrbsp_nonlinear.py", line 3, in <module>
import gurobipy as gp
File "/usr/local/lib/python3.8/site-packages/gurobipy/__init__.py", line 1, in <module>
from .gurobipy import *
ImportError: dlopen(/usr/local/lib/python3.8/site-packages/gurobipy/gurobipy.so, 2): Symbol not found: _PyClass_Type
Referenced from: /usr/local/lib/python3.8/site-packages/gurobipy/gurobipy.so
Expected in: flat namespace
in /usr/local/lib/python3.8/site-packages/gurobipy/gurobipy.so
Here is my workflow starting from the package installation:
1. From $GUROBI_HOME:
$ python3 setup.py build
$ python3 setup.py install
This always worked. What has changed?
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi José,
Is it possible that you used
python setup.py install
instead of
python3 setup.py install
?
Best regards,
Jaromił0 -
Hi Jaromił,
Thanks for the reply!
Yes, I used the python3 setup.py install command.
I imagined that since I'm using python3, that this should be my option for the command.
Because of your question, I executed python setup.py install and now everything is fine.
I'm wondering what was the problem since this is the first time that the command with python3 did not work.0 -
Hi José,
I would expect the same. Maybe something is/was messed up with the Python distribution and installing Gurobi via \(\texttt{python ...}\) fixed it. This is often the case with multiple Python installations, even with just updated Python distributions.
Anyway, good to hear that it works now.Best regards,
Jaromił0 -
Hi, I have the same issue with Gurobi 9.5.1 (experimental version) on mac M1. I tried both python and python3, and they didn't work. Any help would be much appreciated.
0 -
Hi Hamidreza,
Could you please share the error you get? Which Python version are you using? How did you install Gurobi 9.5.1 on your Mac?
Best regards,
Jaromił0
Post is closed for comments.
Comments
6 comments