与TOX为py26

问题描述:

安装熊猫使用tox为使用py26作为ENVS我的一个包运行pytest时,有一个问题(全球ENV是py3.6,py26 ENV是通过pyenv安装py2.6.9)与TOX为py26

Collecting pandas==0.16.2 
    Using cached pandas-0.16.2.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/private/var/folders/pr/ghw8lmr94c5g9ntx4cp9990w0000gn/T/pip-build-cuCAyE/pandas/setup.py", line 406, in <module> 
     from wheel.bdist_wheel import bdist_wheel 
     File "/Users/brianpollack/Coding/scikit-hep/.tox/py26/lib/python2.6/site-packages/wheel/bdist_wheel.py", line 407 
     ignore=lambda x, y: {'PKG-INFO', 'requires.txt', 'SOURCES.txt', 
            ^
    SyntaxError: invalid syntax 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/pr/ghw8lmr94c5g9ntx4cp9990w0000gn/T/pip-build-cuCAyE/pandas/ 

ERROR: could not install deps [setuptools, pytest, PyPDT, numpy<1.12.0, pandas==0.16.2, matplotlib<1.5.0]; v = InvocationError('/Users/brianpollack/Coding/scikit-hep/.tox/py26/bin/pip install setuptools pytest PyPDT numpy<1.12.0 pandas==0.16.2 matplotlib<1.5.0 (see /Users/brianpollack/Coding/scikit-hep/.tox/py26/log/py26-1.log)', 1) 

任何想法,什么是CAU的:

tox.ini文件:pandas安装过程中

[tox] 
envlist = py26,py27,py36 
[testenv] 
deps= 
    pytest 
    PyPDT 
    py26: numpy<1.12.0 
    py{27,36}: numpy 
    py26: pandas==0.16.2 
    py{27,36}: pandas 
    py26: matplotlib<1.5.0 
    py{27,36}: matplotlib<2.1.0 

commands=pytest 

出现以下错误这个语法错误?

编辑:

更新最好的答案:使用-cconstraints.txt执行的wheel

wheeldropped support for Python 2.6降级版本。

要安装wheel兼容的Python 2.6安装版本0.29

source /Users/brianpollack/Coding/scikit-hep/.tox/py26/bin/activate‌​ 
pip uninstall wheel 
pip install wheel==0.29.0 

在tox.ini:

[testenv] 
deps= 
    … 
    py26: wheel==0.29.0 
    … 

或者试试constraints file

[testenv] 
deps= 
    … 
    -cconstraints.txt 
    … 

constraints.txt:

wheel==0.29.0 
+0

谢谢,这确实看起来是问题的根源。但是,即使需要降级车轮版本,也会出现相同的错误。您是否有处方需要pip才能使用后续包装的轮盘版本? –

+0

删除'/ Users/brianpollack/Coding/scikit-hep/.tox/py26'目录并使用更新后的'tox.ini'重新运行'tox'。 – phd

+0

是的,我删除了这个和reran,并且还删除了各种依赖关系的所有缓存轮。我仍然遇到这个错误。我正在使用tox v2.9.1 –