我试图在离线计算机上安装py2neo。我不能使用pip,因为我没有连接到互联网。我试图在redhat上使用python2.7.9安装py2neo-2.0.3。当我运行python setup.py install
时,我得到ImportError: cannot import name HTTPSConnection
。
Traceback (most recent call last):
File "setup.py", line 29, in <module>
from py2neo import __author__, __email__, __license__, __package__, __version__
File "usr/lib/py2neo-2.0.3/py2neo/__init__.py" line 27, in <module>
from py2neo.core import *
File "usr/lib/py2neo-2.0.3/py2neo/core.py", line 28, in <module>
from py2neo.env import NEO4J_AUTH_TOKEN, NEO4J_URI
File "usr/lib/py2neo-2.0.3/py2neo/env.py", line 21, in <module>
from py2neo.packages.httpstream.packages.urimagic import URI
File "usr/lib/py2neo-2.0.3/py2neo/packages/httpstream/__init__.py", line 32, in <module>
from .http import *
File "usr/lib/py2neo-2.0.3/py2neo/packages/httpstream/http.py", line 31, in <module>
from httplib import (BadStatusLine, CannotSendRequest,
ImportError: cannot import name HTTPSConnection
我尝试过安装httpstream但是没有修复导入错误。
答案 0 :(得分:0)
HTTPSConnection
应附带标准库,而不是py2neo本身的一部分:
https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection
我不知道RedHat如何打包Python,但除了主要语言之外,您还可能需要安装SSL支持。我相信这是一个单独的编译选项:
http://www.webtop.com.au/blog/compiling-python-with-ssl-support-fedora-10-2009020237