2014-10-27 75 views
2

我正尝试在Mac 10.10 - https://code.google.com/p/or-tools/wiki/OrToolsWithPyPi上安装Google的or-tools。
我安装使用python2.7 setup.py install --user(也试图使用sudo并没有--user),但得到,当它进入的PyPI下载包中的以下内容:无法在Mac上安装或使用工具10.10

.. 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一切都在,但我正在运行macosx 10.10。 当在https://pypi.python.org/simple/ortools/中查看时,我可以看到3549版本的匹配蛋文件,但它是macosx10.9,这可能是问题吗?为什么setup.py认为我在10.8?

无论如何,它可能不是问题,所以任何其他帮助,非常感激。谢谢!

回答

3

前一种方案(使用easy_installegg文件)

我暂时解决了使用easy-installegg文件(我使用的MacPorts安装easy-install)安装或工具直接安装的问题。这是我如何安装它。

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 

这里是链接地址或工具egg文件,我使用:https://pypi.python.org/pypi/ortools/1.3853

它会给一些警告,但我可以用import ortools没有问题,在Python加载or-tools

新的解决方案(使用pip

我现在可以使用pip安装ortools。但是,默认protobuf版本是2.6.0,因此我必须卸载并重新安装与ortools一起使用的新protobuf版本(例如,在这种情况下,我们将执行3.0.0b4)。

pip install protobuf==3.0.0b4 
pip install ortools 

注意ortools仅与Python 2.6,兼容2.7和3.2不还3.5

+0

我得到的10.10这个问题了。试过这个答案,但得到一个错误:'没有找到本地包或下载链接找到ortools == 1.3853'。有任何想法吗? – joehand 2015-09-18 21:23:07

+0

嗨,乔。是的,我的解决方案现在已经过时了,因为他们没有更新其网站上的ortools软件包(我遇到同样的问题)。我不确定最近的ortools在哪里。如果我找到解决方案,我会尽快回复您。 – titipata 2015-09-21 15:18:27

+0

我得到它安装,但老实说,我无法弄清楚如何!如果我可以重新创建,我会告诉你。有一个更新的OR工具蛋。还请查看[本次讨论](https://groups.google.com/forum/#!msg/or-tools-discuss/17hsQJZhGrE/rQbQy7bNQcEJ),这可能会有所帮助。 – joehand 2015-09-21 20:11:47