I'm a newbie to python and tensorflow and after installing a custom wheel version of tensorflow 1.5.0 using pip install, I created a conda environment using Pycharm. On activating the environment, I observed that the tensorflow isn't one of its packages.
Am just wondering if there was any way I could import the pip installed tensorflow package into the environment without building it with conda and reinstalling it in the environment? Thanks
Edited:
Discovered that you have to install it in the new environment before
you can use it
Related
when i try to import tensorflow from jupyter notebooks. I'm facing a error No module named 'tensorflow' .
But i have installed tensorflow using pip command, and it available in this path c:\program files\python38\lib\site-packages.
please tell me how to access packages installed via pip from jupyter notebooks?
When you installed tensorflow you had a specific environment active and that is where tensorflow was installed. If you are using Anaconda and did not specify which environment to make active it installed it in the base environment. If you want to install tensorflow to a specific environment (lets call it tf) then start the anaconda prompt and enter the text conda activate tf. Then install tensorflow with pip in the same window. My recommendation is to install tensorflow with conda versus pip. conda installs tensorflow and also installs the cuda toolkit and the proper version of cuDNN. pip does not do that. If you install tensorflow with conda I believe it installs version 2.1, cuda toolkit version 10.1.243 and cuDNN version 7.6.5.
I recently installed tensorflow 2.0 by creating a new environment called "tensorflow". I usually activate that environment before doing any work (e.g., calling jupyter notebook) by typing "conda activate tensorflow" in Anaconda prompt.
Sorry i am a beginner in this. it happens that i need to install new package there called tensorflow_datasets . I know that i can do pip install tensorflow_datasets but i am concerned that using pip under this tensorflow conda environment may mess up my tensorflow installation like it did in the past. Can you please advise me on how i should do the installation? would you recommend conda install tensorflow_datasets?
More generally, once we create a new environment how can we install new packages there?
Many Thanks
I use AWS SageMaker for ML software development. In SageMaker, there are several conda environments to choose from. I need to upgrade some packages in a conda environment that are pip installed. From my research, pip and conda are not compatible. So what is the best way to upgrade these pip-installed package?
As an example, the below image shows a conda_tensorflow_p36 environment and the keras package is pip installed. I want to upgrade the keras package to the current version. How do I do that?
You need to specify the name of the conda environment to use when upgrading, so change your conda upgrade keras command to:
conda upgrade -n conda_tensorflow_p36 keras
EDIT: Alternatively, the Install External Libraries and Kernels documentation page for SageMaker gives an example script that downloads/installs an entirely new version/instance of miniconda from the notebook. Then any packages you need (including keras) can be installed into that miniconda instance, independent of the versions provided by SageMaker.
Tried to install tensorflow using conda and its throwing a spec conflict error. I do not have python 3.5 installed
conda install -c conda-forge tensorflow
Fetching package metadata ...............
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- python 3.6*
- tensorflow -> python 3.5*
Use "conda info <package>" to see the dependencies for each package.
python --version
Python 3.6.0 :: Anaconda custom (64-bit)
I cannot seem to run tensorflow on the normal python IDE and it says module not found. So I installed Anaconda and everything seems good except for tensorflow. Any way to install this?
You seem to be installing tensorflow for python3.5 on a python3.6 environment. I would suggest you to create a seperate python environment for tensorflow. You can do it as follows
conda create -n Tensorflow anaconda python=3.5
This will create a anaconda environment called Tensorflow and install all the anaconda packages. You can also specify any other python distribution of your choice. Be sure you download the right tensorflow distribution depending on the python version you choose.
Then activate the newly created anaconda environment as follows
source activate Tensorflow
On windows
activate Tensorflow
This will switch the python environment. Then proceed to installing Tensorflow using pip as follows
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
If you wish to install tensorflow with GPU support, you should install CUDA toolkit and the CUDNNv5.1. More details here
I am using an Ubuntu docker image. I've installed Anaconda on it with no issues. I'm not trying to install tensorflow, using the directions on the tensorflow website:
conda create --name tensorflow python=3.5
source activate tensorflow
<tensorflow> conda install -c conda-forge tensorflow
It installs with no errors. However, when I import in iPython, it tells me there is no module tensorflow. But if I import when in Python, it works fine.
What's going on and how do I fix it?
You have to install IPython in the conda environment
source activate tensorflow
conda install ipython
I went through the same thing. We are installing tensorflow in different conda environment. So It may not consist of all the packages. I needed to install jupyter notebook separately in order to work.