我一直在尝试在ubuntu 14.04 LTS上安装加密python-3.4.3。下载libbfi和libssl后,当我使用pip3安装加密时。这就是我得到的: -
Command /usr/bin/python3 -c "import setuptools,
tokenize;__file__='/tmp/pip_build_gogol/cryptography/setup.py';exec(compile(getattr(tokenize,
'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" install --record /tmp/pip-s1t_s_oy-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_gogol/cryptography Storing debug log for failure in
/home/gogol/.pip/pip.log
如果我再次运行pip3安装,这就是我得到的。
gogol@gogol-Vostro-3558tio:~$ pip3 install cryptography
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named 'packaging'
gogol@gogol-Vostro-3558tio:~$
拜托,任何人都可以帮助我吗?我已经广泛查阅了关于密码学的所有答案,但仍然无法做出任何改变。详细的答案将非常有帮助。提前谢谢。
答案 0 :(得分:1)
所有积分均转到此博客:https://odedrabhavesh.blogspot.ca/2017/02/importerror-no-module-named.html
由于您使用的是python3,请尝试使用root权限:
apt-get purge -y python3-pip
wget https://bootstrap.pypa.io/get-pip.py
python3 ./get-pip.py
然后再次尝试pip install
。
答案 1 :(得分:0)
看起来你错过了打包模块,它需要作为依赖项。尝试:
pip3 install --upgrade pip
pip3 install packaging
然后重试安装加密。