尝试在Kivy Buildozer中安装paramiko和加密时出错

问题描述:

我正在使用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的新手我会尽力做到这一点! –

在命令行中尝试:

python 2.7 import pycrypto 
+0

我试过,但我得到了以下 'kivy @ kivy-VirtualBox的:〜$蟒蛇进口pycrypto 蟒:无法打开文件“进口”:[错误2]没有这样的文件或目录 ' –

+0

你指定Python版本号?从你的日志中看不到你有 –

+0

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