【问题标题】:Setting up CPLEX with Python on Mac在 Mac 上使用 Python 设置 CPLEX
【发布时间】:2017-01-10 17:57:24
【问题描述】:

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

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

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

我正在使用树冠来运​​行 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 的任何帮助,我们将不胜感激!

【问题讨论】:

    标签: python macos terminal cplex


    【解决方案1】:

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

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

    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)。

    【讨论】:

      猜你喜欢
      • 2013-08-16
      • 2017-01-25
      • 2016-08-05
      • 2017-07-23
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多