2017-03-06 46 views
0

我正在使用Kivy作爲虛擬機(在MAC OS中)。我正在嘗試安裝python軟件包pycrypto和paramiko。與pycrypto開始,我試圖嘗試在Kivy Buildozer中安裝paramiko和加密時出錯

pip install pycrypto Requirement already satisfied: pycrypto in /usr/local/lib/python2.7/dist-packages

但是當我嘗試將其導入在Python

>>> import pycrypto Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pycrypto

在paramico,我得到如下:

[email protected]:~$ pip install paramiko 
Collecting paramiko 
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. 
    SNIMissingWarning 
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. 
    InsecurePlatformWarning 
    Using cached paramiko-2.1.2-py2.py3-none-any.whl 
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/dist-packages (from paramiko) 
Collecting cryptography>=1.1 (from paramiko) 
    Using cached cryptography-1.7.2.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-ZboIFP/cryptography/setup.py", line 334, in <module> 
     **keywords_with_side_effects(sys.argv) 
     File "/usr/lib/python2.7/distutils/core.py", line 111, in setup 
     _setup_distribution = dist = klass(attrs) 
     File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__ 
     _Distribution.__init__(self, attrs) 
     File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__ 
     self.finalize_options() 
     File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 386, in finalize_options 
     ep.require(installer=self.fetch_build_egg) 
     File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in require 
     items = working_set.resolve(reqs, env, installer, extras=self.extras) 
     File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 859, in resolve 
     raise VersionConflict(dist, req).with_context(dependent_req) 
    pkg_resources.VersionConflict: (six 1.5.2 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.6.0')) 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ZboIFP/cryptography/ 

任何建議?

+0

也許你的默認PIP和默認的Python是沒有關係的?你能提供'哪個pip'和'哪個python'的輸出(假設你在unix上)。關於paramiko的安裝,看起來你正在試圖在你的系統python中安裝這個軟件包,我認爲它裏面安裝了很多其他的軟件包。看起來他們中的一個需要6個1.5.2而另一個> = 1.6.0。你應該真的把你的依賴關係安裝在virtualenv或編譯python中,並在不同的目錄中運行它。這可能嗎? – nir0s

+0

'kivy @ kivy-VirtualBox:〜$其中pip /usr/local/bin/pip kivy @ kivy-VirtualBox:〜$其中python /usr/bin/python' –

+0

由於我是Unix和Python的新手我會盡力做到這一點! –

回答

1

在命令行中嘗試:

python 2.7 import pycrypto 
+0

我試過,但我得到了以下 'kivy @ kivy-VirtualBox的:〜$蟒蛇進口pycrypto 蟒:無法打開文件「進口」:[錯誤2]沒有這樣的文件或目錄 ' –

+0

你指定Python版本號?從你的日誌中看不到你有 –

+0

'kivy @ kivy-VirtualBox:〜$ python --version Python 2.7.6 ' –