简体   繁体   English

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

[英]Tox conditions to create a lib64 symlink

I have two virtual environments, both have the same version of tox (3.13.2) and the same python (2.7.5). 我有两个虚拟环境,都具有相同的tox版本(3.13.2)和相同的python(2.7.5)。 Using the same tox.ini file, I get two different behaviours: in one case, there is a lib64 symlink, not in the other. 使用相同的tox.ini文件,我得到两种不同的行为:在一种情况下,存在lib64符号链接,而在另一种情况下则没有。

What causes tox to create it? 是什么导致毒素产生呢?

Tox.ini reads: Tox.ini读取:

Set up the run time environment 设置运行时环境

[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}

And command lines show: 命令行显示:

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

☠ pyenv was the culprit! ☠pyenv是罪魁祸首!

If you use a locally installed version, then install tox, then use that tox then no lib64 symlink will be created. 如果使用本地安装的版本,请先安装tox,然后再使用该tox,则不会创建任何lib64符号链接。 However, if you specify pyenv local system as the Python version you want to use, then create your pipenv virtual environment with 但是,如果您将pyenv local system指定为要使用的Python版本,则使用以下命令创建pipenv虚拟环境

pipenv install --ignore-pipfile --python=/usr/bin/python

You should get tox to create a lib64 symlink. 您应该使用tox来创建一个lib64符号链接。

A much better solution (with 20/20 hindsight) is not to rely on lib64 for Python… 一个更好的解决方案(事后分析为20/20)是不要为Python依赖lib64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM