我正在尝试在 mac 10.10 上安装 Google 的 or-tools -https://code.google.com/p/or-tools/wiki/OrToolsWithPyPi https://code.google.com/p/or-tools/wiki/OrToolsWithPyPi .
我安装使用python2.7 setup.py install --user
(也尝试过使用 sudo 且不使用 --user),但是当它转到 pypi 下载软件包时会得到以下信息:
.. Some other output ..
Installed /Users/Zach/Library/Python/2.7/lib/python/site-packages/ortools_examples-1.3549-py2.7.egg
Processing dependencies for ortools-examples==1.3549
Searching for ortools
Reading https://pypi.python.org/simple/ortools/
No local packages or download links found for ortools
error: Could not find suitable distribution for Requirement.parse('ortools')
我注意到它创建了目录build/bdist.macosx-10.8-x86_64/egg
为了构建一切,但我运行的是 mac os x 10.10。
往里看时https://pypi.python.org/simple/ortools/ https://pypi.python.org/simple/ortools/我可以看到版本 3549 的匹配 Egg 文件,但它适用于 macosx10.9,这可能是问题所在吗?为什么 setup.py 认为我使用的是 10.8?
无论如何,这可能不是问题,因此非常感谢任何其他帮助。谢谢!
以前的解决方案 (using easy_install
and egg
file)
我暂时通过安装or-tools使用解决了安装问题easy-install
直接从egg
文件(我使用easy-install
从 MacPorts 安装)。这是我的安装方法。
sudo easy_install-2.7 https://pypi.python.org/packages/2.7/o/ortools/ortools-1.3853-py2.7-macosx-10.9-intel.egg#md5=f1f23b375652d40b9fbce682302e8dc8
这是我使用的 or-tools Egg 文件的链接地址:https://pypi.python.org/pypi/ortools/1.3853 https://pypi.python.org/pypi/ortools/1.3853
它会发出一些警告,但我可以加载or-tools
在Python中通过使用import ortools
没有问题。
新的解决方案 (using pip
)
我现在可以安装ortools
using pip
。然而,默认protobuf
版本是 2.6.0 所以我必须卸载并重新安装新的 protobuf 版本ortools
(例如,在本例中,我们将执行 3.0.0b4)。
pip install protobuf==3.0.0b4
pip install ortools
Note that ortools
仅兼容 Python 2.6、2.7 和 3.2,尚不兼容 3.5
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)