I installed tensor flow from in command prompt and I cant access in anaconda - tensorflow

I have downloaded the tensor flow using pip install tensorflow but when I try to access in the anaconda promy it show no module name tensor flow.
Is asking again to download the TensorFlow.
Kindly help me!

You should not mix conda and pip installations.
First, check if the pip installation you did was successful: run pip freeze and look at the output. If tensorflow is in the list, it was successful.
Then, if it's installed, uninstall it via pip: pip uninstall tensorflow.
Finally, you can install tensorflow through conda by running conda install tensorflow.

Related

Difficulty updating keras/tensorflow on mac

I am working on a jupyter notebook script which I used last year to train a neural network.
When I try to import the keras tokenizer:
from keras.preprocessing.text import Tokenizer
I receive this error
I have seen other posts which suggest that I need to update tensorflow. My anaconda environment tells me I have 1.13.1 installed. But when I try to update tensorflow-base to 1.15 in the anaconda navigator, I receive this error:
I can update tensorflow from my command line using:
conda install tensorflow=1.15.0
But this doesn't update tensorflow in my anaconda environment and the error persists in my notebook.
Any help would be much appreciated! As you can probably tell, I am a novice python user.
The error says some packages needed to update Tensorflow/Andaconda requires Python 3.11 or newer. Since not all of the error log can be seen however, I would upgrade to python 3.7 to be safe. You can download this from the official page: https://www.python.org/downloads/
If the problem persists, try using pip to update the packages(In bash) :
pip install tensorflow
pip install conda
If you get an error while using pip, try:
pip3 install tensorflow
pip3 install conda
This same method can be used to update keras:
pip install keras
or if that does not work:
pip3 install keras
If pip is not recognized at a command, Python 3.7 is not added to path. I do not have experience with macOS, but this article should go into enough depth.
https://realpython.com/add-python-to-path/#how-to-add-python-to-path-on-linux-and-macos

Why isn't tensorflow or pytorch recognized after I restart conda virtual environment?

Last night, I made a virtual environment and the only installs I made were as follows:
conda install jupyter
conda install notebook
pip install transformers
And I was able to run huggingface transformers perfectly, but today I reactivate my conda virtual environment and I'm met with this puzzling error:
And this is the runtime error
I even tried making a new virtual environment with the same depencies and today I got these errors upon performing pip install transformers
And this in jupyter notebook
HuggingFace Transformers need to be installed in conjunction to either Tensorflow or Pytorch. From the HuggingFace installation instructions:
First you need to install one of, or both, TensorFlow 2.0 and PyTorch.
So you should choose which machine learning platform you like more and install that too in your virtual environment.
For Tensorflow either pip install tensorflow or pip install tensorflow-gpu and for Pytorch pip install torch torchvision
For example, in a fresh environment, the following instructions should make your errors disappear (I'm assuming you have a GPU):
conda install jupyter
conda install notebook
pip install tensorflow-gpu
pip install transformers

Adding Tensorflow to my anaconda platform

I have been using anaconda environment. Now that I have installed tensorflow in my windows through the command prompt and following the necessary steps. I am not able to use tensorflow in anaconda platform. Please help. Thank you.
Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow pip python=3.5
Activate the conda environment by issuing the following command:
C:> activate tensorflow
Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command (on a single line):
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu
You can read further by visiting here

Uninstalling TensorFlow from Anaconda environment

Does anyone know how to uninstall TensorFlow from Anaconda environment? I want to upgrade the TensorFlow to the latest version which is ver.1.4, but not working well. So I want to uninstall it and then install the newest version.
You can remove a package with the conda remove command. So for TensorFlow this would be conda remove tensorflow.
If you have installed using pip then use:
pip uninstall tensorflow
The following helped me to completely remove Tensorflow after I used conda remove tensorflow and pip uninstall tensorflow
python3 -m pip uninstall protobuf
python3 -m pip uninstall tensorflow
python3 -m pip uninstall tensorflow-gpu
How to remove packages from Anaconda environment
Step 1:open anaconda navigator and select environment from which package you want to uninstall
Step 2:left click on the rectangular box and select mark for removal and finally click apply button
It can be easily uninstall by
conda uninstall tensorflow
from Anaconda

tensorflow installation error in Window + anaconda

i tried to install tensorflow in my anaconda by creating a virtual env
conda create -n tensorflow python=3.5
but after i type y, nothing happened. How can i fix this?
So what you did is creating an environment called tensorflow, you need to install it as well
you can do either
conda install tensorflow
or
pip install tensorflow