How to use a specific build of Python in my virtual environment

66 views Asked by At

I am trying to create a virtual environment with a specific build of python (specifically, 3.6.7) to develop locally because I am pushing my code to a Heroku stack which only supports this version of Python 3 ( see here ).

As I understand it, this specific build of python must already be installed on my machine so I can do something like virtualenv --python=/path/to/python3.6.7 env_directory. My questions are:

  1. What is the easy way to install Python-3.6.7 on both Ubuntu and OSX (I will be developing in both operating systems)?
  2. Is there some virtual environment tool out there that can download a specific build automatically?
1

There are 1 answers

0
raindrop On

Pyenv ( https://github.com/pyenv/pyenv ) lets you easily install multiple versions of python on your system.