Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Tox can't find python3.x executable in virtualenv #202
After creating a virtualenv with:
I'm not able to run tox with this ini file:
The following error appears:
After checking my virtualenv it's clear that it doesn't contain a python3.5 symlink.
After creating the
Shouldn't all executables (python, pythonx and python x.y) be available in the virtualenv?
Thanks! But should I really have to use another plugin to get the expected behaviour?
To me it just feels like there should be a pythonX.Y symlink in the virtualenv's bin folder after creating a new virtualenv. Since the executables are present in the system's python and also pyenv installed python versions I'd expect to find similar symlinks in the virtualenvs as well.
But if you disagree, feel free to close this issue.
To anyone that finds this thread and experience the same issue and don't want to use yet another plugin to solve it.
I've found a workaround to this issue.
By specifying exactly which python binary you want to use you can get the expected behaviour.
will create a virtualenv with the following contents in ./bin
The plugin (probably the python
I have same problem:
I could not get
However @gangefors suggestion above does work
If I delete my virtualenv and recreate it with
So it seems to be down to pyenv-virtualenv not creating the
@gangefors : The solution you suggested (pyenv virtualenv -p python3.5 3.5.3 myenv) works.
ERROR: py36: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError('Failed to get version_info for python3.6: b"pyenv: python3.6: command not found\n\nThe `python3.6' command exists in these Python versions:\n 3.6.0\n 3.6.1\n\n"',)
How do we overcome this issues ? Can you suggest please ?
@madhurabhogate I would suggest that you create different venvs for different python versions. Then you can use them at the same time with
Note that there is a small typo in @gangefors 's example (at least for pyenv 1.2.7) with a flag:
$ brew install pyenv-virtualenv $ pyenv virtualenv -p python3.5 3.5.6 py35 $ pyenv virtualenv -p python3.6 3.6.6 py36 $ pyenv virtualenv -p python3.7 3.7.0 py37 $ pyenv shell py35 py36 py37
If using with tox, order of cmds seems to be a tiny bit finnicky and very particular:
$ pyenv shell py35 py36 py37 $ python3.7 -m venv venv $ source ./venv/bin/activate $ tox
i was able to fix this in a docker build here
The "gist" of it all is below: