I know that this doesn't answer the question exactly, but for completeness I'd like to add an Anaconda solution. Provided that an Anaconda environment is present on the system, a new Python environment can be created using conda create -n py36 python=3.6 pip
. The name py36
can be arbitrarily chosen (could also be e.g. myenv
or tensorflow
), the desired Python version (in this example 3.6) is specified by python=3.6
.
This environment can then be activated using conda activate py36
(or whatever name you assigned in the previous step). Once the environment is active, you can install tensorflow
via pip
: pip install tensorflow-gpu
. To deactivate the current environment and return to the default environment, use conda deactivate
. In this way, you don't have to modify PATH
variables.
See also this documentation page for more details on the Anaconda environment.