我正在尝试构建docker镜像。我有一个install.sh文件,它将在构建时运行。install.sh的内容如下
sudo apt-get install -y python-dev python3.5 python3.5-dev
# Install virtualenv
sudo wget https://bootstrap.pypa.io/ez_setup.py -O /tmp/ez_setup.py
sudo python3.5 /tmp/ez_setup.py
sudo easy_install-3.5 pip
pip3.5 install virtualenv
#pip install -U cffi
virtualenv -p python3.5 $HOME/venv/3.5
# Install pip packages
. $HOME/venv/3.5/bin/activate
pip install pyopenssl ndg-httpsclient pyasn1
pip install nose mock pytest coverage
CFLAGS="-O0" pip install lxml
deactivate
执行时pip install pyopenssl ndg-httpsclient pyasn1
,我收到以下错误
running install_egg_info
Copying src/cryptography.egg-info to build/bdist.linux-x86_64/wheel/cryptography-1.1.1-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ytr1o8ux/cryptography/setup.py", line 318, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/root/venv/3.5/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/root/venv/3.5/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/root/venv/3.5/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Running setup.py bdist_wheel for cffi
Failed building wheel for cryptography
看完这个之后关联,我尝试使用更新的wheels包
wget http://nipy.bic.berkeley.edu/scipy_installers/wheel-0.24.0-py2.py3-none-any.whl
pip install wheel-0.24.0-py2.py3-non-any.whl
仍然是同样的错误。尽管出现此错误,但图像已成功构建。如能提供任何帮助,我们将不胜感激。
提前致谢。
答案1
wheel
这似乎是该票中描述的包裹的问题:https://bitbucket.org/pypa/wheel/issues/146/wheel-building-fails-on-cpython-350b3
在虚拟环境中升级wheel
应该可以解决问题(0.26.0
目前的版本)。