1

I installed tox globally via pipx as follows:

pipx install tox
tox --version
4.6.4

I have installed Python 3.10 via pyenv as follows:

pyenv install 3.10.12

However, when I run tox with a py310 environment, I get the following error message:

skipped because could not find python interpreter with spec(s): py310

How can I get tox (installed via pipx) to recognise the versions of Python I installed via pyenv?

Dawngerpony
  • 3,288
  • 2
  • 34
  • 32

1 Answers1

2

I went through a few iterations before I found a solution. First of all I found the tox-pyenv plugin but it turns out that the plugin has been deprecated since tox 4.

I tried setting the VIRTUALENV_DISCOVERY environment variable recommended in the README of the tox-pyenv plugin but then tox threw a bunch of exceptions.

So in the end I configured all required versions in my project directory via pyenv local 3.10.12 3.11.4 and now tox runs just fine.

I hope this helps someone else!

PS. If you really want to use tox-pyenv with tox 3.x, check out this answer. If you've installed tox via pipx, try the pipx inject command to install tox-pyenv into the same pipx environment where tox is installed.

Dawngerpony
  • 3,288
  • 2
  • 34
  • 32