2

I want to use a tensorflow version 1.0.0 which is installed in my virtualenv.

I am importing tensorflow in my jupyter notebook, but global tensorflow version is only getting imported.

how to import the version of tensorflow into jupyter notebook which i installed in virtualenv?

Marison
  • 149
  • 1
  • 11
  • 2
    You should have installed only one version of TensorFlow in your virtualenv. If you have one version installed there and you are seeing a different version from the Python interpreter, it might be that you are running the global interpreter, not the one from the virtualenv. If you are using Jupyter Notebook (or IPython, or any other interface to the interpreter), make sure you are using the one installed in the virtualenv (that is, install Jupyter notebook in your virtualenv and run it from there). – jdehesa Jan 03 '19 at 12:52
  • Thank you @jdehesa. Now it is working. I was running jupyter notebook in global env , that's y i was not able to use the one which was installed in virtualenv. – Marison Jan 03 '19 at 13:03

1 Answers1

0

Providing the solution here (Answer Section) even though it is present in Comments Section (Thanks to @jdehesa) for the benefit of the Community.

When we have multiple Virtual Environments and if each Virtual Environment has a different version of Tensorflow, in order to use a specific Tensorflow Version, we have to activate the respective Virtual Environment.

The command for Activating the Virtual Environment using Conda for different Operating Systems are shown below:

# Activate the Virtual Environment. Conda Version > 4.6 and Windows OS
conda activate TF_2_VE

# Activating Virtual Environment, Conda Version < 4.6 and Windows OS
activate TF_2_VE

# Activating Virtual Environment, Conda Version < 4.6 and Linux and Mac OS
source activate TF_2_VE

To know how to Activate a Virtual Environment using Python, refer this Stack Overflow Issue.