I am having some trouble with creating virtual environments using pyenv.
This works fine:
$ pyenv local 3.6.0
$ python
>>> Python 3.6.0 (default, Jul 21 2019, 14:03:29)
>>> [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] on darwin
>>> ...
But then when I create a virtual environment (which I assume done with Python 3.6.0) and activate it, I get Python 3.7.4. The same happens if I use python3.6 -m venv venv
.
$ python -m venv venv
$ source venv/bin/activate
$ python
>>> Python 3.7.4 (default, Jul 9 2019, 18:13:23)
>>> [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Putting that into words, I want to create a virtual environment with the same version that is currently active via pyenv. What am I missing here?
Some info to my system:
- I am on macOS.
- I have installed Python 3.7.4 via Homebrew, and it's the default version for
python3
. - If I call
python
only without having activated pyenv in my shell, I get Python 2.7.16 interpreter.