在Mac上使用Python设置CPLEX

时间:2017-01-10 17:57:25

标签: python macos terminal cplex

我正在尝试在我的Mac上在Python上安装cplex但我真的卡住了。

setup.py文件位于以下路径中:

/Users/mac/Applications/IBM/ILOG/CPLEX_Studio127/cplex/python/2.7/x86-64_osx

我正在使用canopy来运行Python。

我在Mac终端中输入了以下代码,结果如下:

macs-mbp:~ mac$ python setup.py install
/Users/mac/Library/Enthought/Canopy_64bit/User/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
macs-mbp:~ mac$ 

然后我决定使用(option --home),但结果也很糟糕:

macs-mbp:~ mac$ python setup.py install --home /Users/mac/Applications/IBM/ILOG/CPLEX_Studio127/cplex

/Users/mac/Library/Enthought/Canopy_64bit/User/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
macs-mbp:~ mac$ 

我也尝试使用cd,但这并没有带来改进。

在Mac上安装Python上的cplex时,我们将不胜感激!

1 个答案:

答案 0 :(得分:2)

这看起来可能类似于this SO问题。

如果您执行以下操作会发生什么:

cd /Users/mac/Applications/IBM/ILOG/CPLEX_Studio127/cplex/python/2.7/x86-64_osx
python setup.py install

另外,你必须确保上面的“python”指向你想要的python(canopy vs system python)。