无法在Mac 10.10上安装or-tools [英] can't install or-tools on mac 10.10
问题描述
我正在尝试在Mac 10.10上安装Google的或工具- https://code.google.com/p/or-tools/wiki/OrToolsWithPyPi .
我使用python2.7 setup.py install --user
进行安装(也尝试使用sudo且不使用--user),但在pypi上下载软件包时得到以下内容:
I'm trying to install Google's or-tools on mac 10.10 - https://code.google.com/p/or-tools/wiki/OrToolsWithPyPi .
I install using python2.7 setup.py install --user
(tried also with sudo and without --user) but get the following when it goes to pypi to download the package:
.. 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的匹配egg文件,但是用于macosx10.9,可能是问题所在吗?为什么setup.py认为我在10.8上?
I noticed that it creates the directory build/bdist.macosx-10.8-x86_64/egg
in order to build everything in but I'm running macosx 10.10.
When looking in https://pypi.python.org/simple/ortools/ I can see a matching egg file for version 3549 but it's for macosx10.9, could that be the problem? Why does setup.py thinks I'm on 10.8?
无论如何,这可能不是问题,因此非常感谢您提供其他帮助.谢谢!
Anyway, it might not be the problem, so any other help is very appreciated. Thanks!
推荐答案
以前的解决方案(使用easy_install
和egg
文件)
我暂时通过直接从egg
文件中使用easy-install
安装或工具来解决安装问题(我使用从MacPorts安装的easy-install
).这是我的安装方式.
I temporarily solve the problem of installing by installing or-tools using easy-install
directly from the egg
file (I use easy-install
installed from MacPorts). Here is how I install it.
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蛋文件的链接地址: https://pypi .python.org/pypi/ortools/1.3853
Here is the link address for or-tools egg file that I use: https://pypi.python.org/pypi/ortools/1.3853
它将给出一些警告,但是我可以使用import ortools
毫无问题地在Python中加载or-tools
.
It will give some warning but I can load or-tools
in Python by using import ortools
with no problem.
新解决方案(使用pip
)
我现在可以使用pip
安装ortools
.但是,默认的protobuf
版本为2.6.0,因此我必须卸载并重新安装可与ortools
一起使用的新protobuf版本(例如,在这种情况下,我们将执行3.0.0b4).
I can now install ortools
using pip
. However, default protobuf
version is 2.6.0 so I have to uninstall and reinstall new protobuf version that works with ortools
(e.g. in this case, we will do 3.0.0b4).
pip install protobuf==3.0.0b4
pip install ortools
注意,ortools
仅与Python 2.6、2.7和3.2兼容,尚不兼容3.5
Note that ortools
is only compatible with Python 2.6, 2.7, and 3.2 not 3.5 yet
这篇关于无法在Mac 10.10上安装or-tools的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!