I've spotted some similar questions/answers, but not what I'm having. Thanks for your help!
System : ubuntu 20.04 fresh install, python 3.8.5 system installed and pyenv running just fine. Tox,though, creates the venv but keeps running the system interpreter.
pyenv running great :
aj@jaja:/tmp$ python --version
Python 3.8.5
aj@jaja:/tmp$ pyenv versions
* system (set by /home/aj/.pyenv/version)
3.6.13
pypy3.6-7.0.0
aj@jaja:/tmp$ pyenv local 3.6.13
aj@jaja:/tmp$ python --version
Python 3.6.13
my tox.ini :
[tox]
envlist = 3.6.13, 3.8.5
skipsdist = True
[testenv]
deps =
pytest
commands =
python --version
python -c 'import sys; print(sys.executable)'
pytest
tox seems to create the venv just fine:
aj@jaja:/tmp/foo$ tox -l
3.6.13
3.8.5
but it's always running the system interpreter instead of the venv one:
3.6.13 installed: attrs==20.3.0,iniconfig==1.1.1,packaging==20.9,pluggy==0.13.1,py==1.10.0,pyparsing==2.4.7,pytest==6.2.2,toml==0.10.2
3.6.13 run-test-pre: PYTHONHASHSEED='3215808768'
3.6.13 run-test: commands[0] | python --version
**Python 3.8.5**
3.6.13 run-test: commands[1] | python -c 'import sys; print(sys.executable)'
**/tmp/foo/.tox/3.6.13/bin/python**
3.6.13 run-test: commands[2] | pytest
======================================================================= test session starts =======================================================================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
cachedir: .tox/3.6.13/.pytest_cache
rootdir: /tmp/foo
collected 1 item
test_calc.py .
the pyenv of interest shows that, but I don't know how correct it using tox directly:
aj@jaja:/tmp/foo$ cat .tox/3.6.13/pyvenv.cfg
home = /usr
implementation = CPython
version_info = 3.8.5.final.0
virtualenv = 20.4.3
include-system-site-packages = false
base-prefix = /usr
base-exec-prefix = /usr
base-executable = /usr/bin/python3.8