Tox条件创建一个lib64符号链接

时间:2019-09-02 11:33:29

标签: python python-2.7 tox pyenv

我有两个虚拟环境,都具有相同的tox版本(3.13.2)和相同的python(2.7.5)。使用相同的tox.ini文件,我得到两种不同的行为:在一种情况下,存在lib64符号链接,而在另一种情况下则没有。

是什么导致毒素产生的?

Tox.ini读取:

设置运行时环境

[tox]
envlist = env
minversion = 1.7.0
toxworkdir = {toxinidir}/virtenv
skipsdist = True

[testenv:rprs-env]
setenv=
    VIRTUAL_ENV = {envdir}
    PIP_USE_WHEEL= true
    PIP_NO_INDEX = true
deps = -r{toxinidir}/tox/requirements-pinned.txt
install_command = pip install --pre --find-links={toxinidir}/tox/wheelhouse {packages}

命令行显示:

test-devtree-Sxi7_C_t(feature/DTD-12|+4); ~/.virtualenvs/test_rprs_bootstrap/bin/tox -c tox.ini -r
env recreate: /home/usr/repos/test-devtree/Run/virtenv/env
env installdeps: -r/home/usr/repos/test-devtree/Run/tox/requirements-pinned.txt
env installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support,backports.functools-lru-cache==1.5,blosc==1.2.4,click==6.7,click-help-colors==0.4,colored-traceback==0.3.0,coloredlogs==10.0,cycler==0.10.0,Cython==0.24.1,docopt==0.6.2,enum==0.4.6,enum34==1.1.6,funcsigs==1.0.2,future==0.16.0,h5py==2.5.0,h5pyViewer==0.0.1.3,hickle==1.3.0,humanfriendly==4.16.1,humanize==0.5.1,kiwisolver==1.0.1,matplotlib==2.2.3,mock==1.0.0,monotonic==1.5,MySQL-python==1.2.3,nose==1.3.7,numexpr==2.6.8,numpy==1.15.1,pandas==0.23.4,pbr==1.10.0,py==1.4.30,Pygments==2.0.2,pyparsing==2.1.10,python-cjson==1.0.5,python-dateutil==2.7.3,pytz==2016.7,scipy==1.1.0,six==1.11.0,SQLAlchemy==0.9.7,subprocess32==3.2.7,sympy==0.7.6,tables==3.4.4,tox==1.7.0,Twisted==11.0.0,ujson==1.33,virtualenv==1.11.4,xlwt==1.0.0,zope.interface==4.1.1
env run-test-pre: PYTHONHASHSEED='1275167437'
__________________________________________________________________________________________________________________________________________________________ summary __________________________________________________________________________________________________________________________________________________________
  env: commands succeeded
  congratulations :)
test-devtree-Sxi7_C_t(feature/DTD-12|+4); ls -l virtenv/env/
total 4.0K
4.0K drwxrwxr-x. 2 usr usr 4.0K Sep  2 12:25 bin/
   0 drwxrwxr-x. 2 usr usr   22 Sep  2 12:25 include/
   0 drwxrwxr-x. 3 usr usr   22 Sep  2 12:25 lib/
   0 lrwxrwxrwx. 1 usr usr    3 Sep  2 12:25 lib64 -> lib/
   0 drwxrwxr-x. 2 usr usr   81 Sep  2 12:25 log/
   0 drwxrwxr-x. 3 usr usr   17 Sep  2 12:25 man/
   0 drwxrwxr-x. 3 usr usr   16 Sep  2 12:25 share/
   0 drwxrwxr-x. 2 usr usr    6 Sep  2 12:25 tmp/
test-devtree-Sxi7_C_t(feature/DTD-12|+4); tox -c tox.ini -r 
env recreate: /home/usr/repos/test-devtree/Run/virtenv/env
env installdeps: -r/home/usr/repos/test-devtree/Run/tox/requirements-pinned.txt
env installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support,backports.functools-lru-cache==1.5,blosc==1.2.4,click==6.7,click-help-colors==0.4,colored-traceback==0.3.0,coloredlogs==10.0,cycler==0.10.0,Cython==0.24.1,docopt==0.6.2,enum==0.4.6,enum34==1.1.6,funcsigs==1.0.2,future==0.16.0,h5py==2.5.0,h5pyViewer==0.0.1.3,hickle==1.3.0,humanfriendly==4.16.1,humanize==0.5.1,kiwisolver==1.0.1,matplotlib==2.2.3,mock==1.0.0,monotonic==1.5,MySQL-python==1.2.3,nose==1.3.7,numexpr==2.6.8,numpy==1.15.1,pandas==0.23.4,pbr==1.10.0,py==1.4.30,Pygments==2.0.2,pyparsing==2.1.10,python-cjson==1.0.5,python-dateutil==2.7.3,pytz==2016.7,scipy==1.1.0,six==1.11.0,SQLAlchemy==0.9.7,subprocess32==3.2.7,sympy==0.7.6,tables==3.4.4,tox==1.7.0,Twisted==11.0.0,ujson==1.33,virtualenv==1.11.4,xlwt==1.0.0,zope.interface==4.1.1
env run-test-pre: PYTHONHASHSEED='3823901851'
__________________________________________________________________________________________________________________________________________________________ summary __________________________________________________________________________________________________________________________________________________________
  env: commands succeeded
  congratulations :)
test-devtree-Sxi7_C_t(feature/DTD-12|+4); ls -l virtenv/env/
total 4.0K
4.0K drwxrwxr-x. 2 usr usr 4.0K Sep  2 12:26 bin/
   0 drwxrwxr-x. 2 usr usr   22 Sep  2 12:25 include/
   0 drwxrwxr-x. 3 usr usr   22 Sep  2 12:25 lib/
   0 drwxrwxr-x. 2 usr usr   81 Sep  2 12:26 log/
   0 drwxrwxr-x. 3 usr usr   17 Sep  2 12:25 man/
   0 drwxrwxr-x. 3 usr usr   16 Sep  2 12:26 share/
   0 drwxrwxr-x. 2 usr usr    6 Sep  2 12:26 tmp/
test-devtree-Sxi7_C_t(feature/DTD-12|+4); tox --version    
3.13.2 imported from /home/usr/.virtualenvs/test-devtree-Sxi7_C_t/lib/python2.7/site-packages/tox/__init__.pyc
test-devtree-Sxi7_C_t(feature/DTD-12|+4); ~/.virtualenvs/test_rprs_bootstrap/bin/tox --version    
3.13.2 imported from /home/usr/.virtualenvs/test_rprs_bootstrap/lib/python2.7/site-packages/tox/__init__.pyc

1 个答案:

答案 0 :(得分:0)

☠pyenv是罪魁祸首!

如果您使用本地安装的版本,请先安装tox,然后使用该tox,然后将不会创建任何lib64符号链接。但是,如果您将pyenv local system指定为要使用的Python版本,则使用

创建pipenv虚拟环境
pipenv install --ignore-pipfile --python=/usr/bin/python

您应该使用tox来创建一个lib64符号链接。

一个更好的解决方案(事后分析为20/20)是不依赖于Python的lib64……

相关问题