I have Python 3.7 installed on my computer. I want to use tensorflow and just found out that it basically doesn't support 3.7, so I'd like to (also) install Python 3.6.
Any suggestions of how to do that? Do I have to uninstall 3.7 and replace it by 3.6 or is there a way to just use 3.6 for the stuff related to tensorflow?
If you wish to use multiple versions of Python on a single machine, then pyenv is a commonly used tool to install and switch between versions. This is not to be confused with the previously mentioned depreciated pyvenv script. It does not come bundled with Python and must be installed separately.
Install multiple python versions For Windows users, I recommend using the Windows x86-64 executable installer option if you work on a 64bit system. Otherwise, just use the Windows x86 executable installer . After locating the install option for the specific version, just press the download link.
You should just install Python 3.7 and Python 3.8 and make sure that the Python Launcher for Windows is also installed (this is the default). Then you could run your scripts using py -3.7 main.py or py -3.8 main.py to run main.py using Python versions 3.7 or 3.8, respectively.
I found this to work after searching for a while. Here are the steps I followed to install an older python version alongside my standard one:
tar -xvzf Python-3.6.6.tgz
cd Python-3.6.6
./configure
make altinstall
to install it (install
vs altinstall
explanation here Difference in details between "make install" and "make altinstall")You'll normally find your new python install under /usr/local/bin
. Now you can create a new virtualenv specifying the python version to use with:
virtualenv --python=python3.6 env3.6
source env3.6/bin/activate
.pip3 install tensorflow
One of the recommended ways to have multiple python installations with differing libraries installed is to use Virtualenv. This gives you the possibility to have a specific python environment with it's own set of dependencies for each project you work on. This works not only for the dependencies, but also for different versions of python.
On top of that you can use Pipenv to manage the different virtualenvs. In a Pipfile
you can describe your required python and it's dependencies which is used by Pipenv
to manage a python env specific for your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With