pip安装期货休息点,但仅限于amazonlinux?

时间:2018-03-31 02:02:20

标签: python pip amazon-linux

这可能属于“不要这样做”类别,给定https://github.com/agronholm/pythonfutures/issues/41 - 它是一个专门用于Python 2的后端库。但奇怪的是,我看到安装它会导致症状是在亚马逊Linux上尤其糟糕,而在其他地方并不明显。测试用例:

$ docker run -it amazonlinux /bin/bash
bash-4.2# yum install -y python36-virtualenv > /dev/null
bash-4.2# virtualenv-3.6 ~/testenv
Using base prefix '/usr'
New python executable in /root/testenv/bin/python3.6
Also creating executable in /root/testenv/bin/python
Installing setuptools, pip, wheel...done.
bash-4.2# source ~/testenv/bin/activate
(testenv) bash-4.2# pip --version
pip 9.0.3 from /root/testenv/local/lib/python3.6/site-packages (python 3.6)
(testenv) bash-4.2# pip install futures
Collecting futures
  Downloading futures-3.1.1.tar.gz
Building wheels for collected packages: futures
  Running setup.py bdist_wheel for futures ... done
  Stored in directory: /root/.cache/pip/wheels/ad/79/48/b32521764d59b16fd1bc0ffd
5862f6d3bf770c7d73ea1fb12a
Successfully built futures
Installing collected packages: futures
Successfully installed futures-3.1.1
(testenv) bash-4.2# pip --version
Traceback (most recent call last):
  File "/root/testenv/bin/pip", line 7, in <module>
    from pip import main
  File "/root/testenv/local/lib/python3.6/site-packages/pip/__init__.py", line 4
5, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/root/testenv/local/lib/python3.6/site-packages/pip/vcs/subversion.py",
line 9, in <module>
    from pip.index import Link
  File "/root/testenv/local/lib/python3.6/site-packages/pip/index.py", line 31,
in <module>
    from pip.wheel import Wheel, wheel_ext
  File "/root/testenv/local/lib/python3.6/site-packages/pip/wheel.py", line 6, i
n <module>
    import compileall
  File "/usr/lib64/python3.6/compileall.py", line 20, in <module>
    from concurrent.futures import ProcessPoolExecutor
  File "/root/testenv/local/lib/python3.6/site-packages/concurrent/futures/__ini
t__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "/root/testenv/local/lib/python3.6/site-packages/concurrent/futures/_base
.py", line 381
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax

简单地在其他Linux发行版上安装python 3上的期货包似乎不会导致pip中断,我还没能在Ubuntu或Fedora上引起相同的症状。 amazonlinux上的virtualenv内部发生了什么导致这个问题特别糟糕?如果我通过pip而不是amazon linux yum包python36-virtualenv安装virtualenv,问题就不会在那里出现。

0 个答案:

没有答案