How do I upgrade to Tensorflow 1.0 using anaconda? - python

I have an anaconda installation of tensorflow (version 0.9.0) and I can't upgrade it to 1.0.
When I run
conda install tensorflow=1.0.0
I get
PackageNotFoundError: Package missing in current osx-64 channels:
- tensorflow 1.0.0*
When I try
pip install --ignore-installed --upgrade https://storage.googleapiscom/tensorflow/mac/cpu/tensorflow-1.1.0-py3-none-any.whl
It times out. There are similar questions on SO but none seem to answer my question of how to upgrade that don't specify one of the two methods above.

Tensorflow 1.0.0 is not available in the default Anaconda channel for OS X. Check with "conda list" that tensorflow is not already installed on your system. If it is, remove using
conda uninstall tensorflow
You can install 1.0.0 by installing from the conda-forge channel
conda install -c conda-forge tensorflow=1.0.0

For anaconda installation, first pick a channel which has the latest version of TensorFlow binary. The latest versions are usually available at the channel conda-forge. So, simply do:
# `-f` will force the current installation to upgrade
# `-c conda-forge` means we select `conda-forge` channel
$ conda update -f -c conda-forge tensorflow
This will upgrade your existing TensorFlow installation to the very latest version available. As of this writing, the latest version is 1.4.0-py36_0

Related

Install Tensorflow 2.2 for Python 3.8 in Anaconda (Windows x64)

I've just installed the latest version of Anaconda for Windows x64 with Python 3.8 and would like to add the tensorflow module.
According to this website, tensorflow 2.2.0 should be available.
However, my Anaconda only suggests tensorflow 2.1.0 and fails to install it because it's not compatible with Python 3.8.
How can I install tensorflow 2.2.0?
If you installed tensorflow2.1 using Conda it automatically installed cudnn 7.6.5 and CUDA Toolkit 10.1.243. These are compatible with tensorflow 2.2. Then use pip to install tensorflow 2.2 as shown below
pip install tensorflow ==2.2.0
Conda at this time can only install tensorflow up to 2.1 that is why you have to use pip. pip does not automatically install cudnn or the Cuda toolkit but you already have them installed when you install version 2.1 with Conda. Otherwise you would have to go through a more complicated process to manually install cudnn and the toolkit. Some people have reported problems using python 3.8 with tensorflow. If you run into that create as seperate environment and install python 3.7, tensorflow 2.1 using conda, the tensorflow 2.2 using pip.
For this you might want to downgrade the Python to v3.7.
It is always a good practice to run TensorFlow in the lower-tested version of python. (Thats what I do.) And it just works as good as it would run in Python 3.8.
For this you might use the virtual environment using.
Create using:
conda create -n env_name python=3.7
And then just activate using:
conda activate env_name
And to install TensorFlow 2.2 just run:
pip install tensorflow==2.2.0
And once you are done, run:
conda deactivate
AnjaM,
I faced same problem. The other Conda page here still reports that their latest TF for Windows is 2.1.0. See screenshot below.
It may be a matter of days but I personally got tired of waiting and installed TF 2.3.0 with pip. 2.1.0 was throwing errors where 2.3.0 would work fine.
Tips for installation:
do it in separate virtual environment
install all other needed packages fist and then install TF with pip
when updating other packages - don't let conda to downgrade TF.
I was having the same problem.
So, I installed tensorflow-gpu==2.2.0 with 'pip'.
then installed cudann = 7.6.5 and cudatoolkit==10.1.243
pip install tensorflow-gpu=2.2.0
conda install cudatoolkit==10.1.243
conda install cudnn==7.6.5
You need to add conda-forge as one of the package sources with this command:
conda config --add channels conda-forge
Once you do this, just update the package index and you'll be able to see the latest versions of all packages.

Install Tensorflow 2.0 in conda enviroment

I would like to know if anyone knows how can I install tensorflow==2.0.0-alpha0 in a conda enviroment using python 3.7. Is it possible to use python 3.7 or do I have to downgrade to 3.6. Either way what is the command I need to use because the following don't find any package
conda install tensorflow==2.0.0-alpha0
conda install tensorflow
conda install tensorflow=2.0.0-alpha0
I am using fedora 29 and conda 4.6.8
Thanks!
TENSORFLOW 2.0 release version is out!
Since 01/10/2019 I'm not talking beta but the release version.
Using Anaconda
Since 01/11/2019 Anaconda is supporting the Tensorflow 2.0.0.
Option 1: For what the easiest way is just:
conda install tensorflow or conda install tensorflow-gpu
For the gpu mode, anaconda will take care of all the CUDA everything you need to install for the tensorflow gpu mode to work so I strongly recommend using this method.
The only issue with this method is that anaconda might not have the last last version of TensorFlow. For example, at Feb 21 2021, conda has the version 2.3 whereas the PIP version is 2.4. You can check the current version of gpu or cpu.
Option 2 (virtual env): It is strongly recommended to use an environment on where to install tensorflow, for which you need the following command that will create an environment first and then install tensorflow within:
CPU: conda create -n <your_env_name> tensorflow
GPU: conda create -n <your_env_name> tensorflow-gpu
Change <your_env_name> by a meaningful name like tf-2
To use tensorflow run first conda activate <your_env_name>
Using pip
Using pip the tensorflow official instructions are quite complete.
Just install tensorflow using pip like:
# Current stable release for CPU-only
pip install tensorflow
I yet recommend before doing everything to install tensorflow in a new environment so the 3 steps would be (with anaconda):
conda create --n <our_env_name> pip
conda activate <your_env_name>
pip install tensorflow
Now for the GPU version it's harder with pip, I recommend you this link that explains the extra things you need to install (CUDA and others).
It could be the case that the package version you want is not available in conda-forge. What you could do is install packages with pip in your conda environment.
pip install tensorflow==2.0.0-alpha0
Also the requirements don't state python 3.7, you can try your luck or downgrade to python 3.6.
You can now install TF2 for Python 3.7 using conda. You can run the usual
$ conda install tensorflow=2.0 python=3.7
or
$ conda install tensorflow-gpu=2.0 python=3.7
for the GPU version.
My preferred approach however would be to manage the dependencies using an environment.yml file. You can find examples of how to do this for TF2 and dependencies in these template repos that I created on GitHub.
https://github.com/kaust-vislab/tensorflow-cpu-data-science-project
https://github.com/kaust-vislab/tensorflow-gpu-data-science-project
The problem is in conda install tensorflow.
conda does not have tensorflow. You will require to install tensorflow using pip. You do not need to downgrade your Python. It will work with Python 3.7.
Use this
$ pip install --upgrade tensorflow==2.0.0-beta0
Since the beta0 version is released, I mentioned that. You can choose other tf version.
I recommend going through this post on TowardsDataScience: Step-by-Step Guide to Install Tensorflow 2.0.
This post covers installation steps with conda.
You might want to take a look at this link: https://pypi.org/project/tf-nightly-2.0-preview/#files to see which python version and OS supports your package
I tried to install tensorflow v2 with conda install tensorflow or conda install tensorflow-gpu only to get lots of incompatible dependencies.
Just run
pip install -upgrade tensorflow-gpu
or
pip install tensorflow-gpu=2.0.0 for a specific version
Use ' pip install tensorflow-gpu '. This command does the job - downloads Tensorflow-gpu = 2.4.1

Half of anaconda3 has py27 build path

While trying to install a particular package using conda, I didn't notice how many packages were going to be downgraded and foolishly gave the go-ahead. For the most part, the version numbers weren't downgraded, but they downgraded from a py37 build channel to a py27 build channel. Running conda list now gives me lines with a mix of py27 and py37:
jupyter 1.0.0 py37_7
jupyter_client 5.2.4 py27_0
jupyter_console 5.2.0 py27_1
jupyter_core 4.4.0 py27_0
jupyterlab 0.35.3 py37_0
I can't remember what it looked like before, but I don't believe I had this garbled mess of python2 and python3, as I haven't built anything with python2 into my conda. Running conda update --all doesn't resolve this, as I believe it only checks the version and not the build path. How can I change everything back to python3 and ideally remove all traces of python2?
Edit:
The line in particular that caused this was conda install -c menpo vtk=7 when trying to install DAETools
I think the easiest way to fix this should be to explicitly install python=3, i.e.:
conda install python=3
possibly this will want to remove vtk again, but when I specified python=3, I got a version of vtk=7 build with python 3.5 from the same channel you used, i.e. there is a python 3 version available.
It's also possible to revert your anaconda distribution back to 'factory settings' by executing conda update conda, followed by conda install anaconda. Afterwards all your package versions should be the same as the ones that you would have after a fresh installation of the (latest) full Anaconda distribution.

cannot install tensorflow on anaconda

i am trying to install tensorflow on anaconda
i tried conda install -c conda-forge tensorflow
but the installation stuck on Solving environment:
looked for a solution so someone suggested to install with debug
conda install --debug -c conda-forge tensorflow
but it stopped on
DEBUG conda.resolve:filter_group(277): tensorboard: pruned from 47 -> 0
how to fix this?
For python version 3.7, you need to first downgrade to 3.6 using conda install python=3.6. After that, the installation should work. I had a similar problem recently.
What it worked for me was:
I uninstalled old versions of python and anaconda from my PC.
I installed anaconda (Anaconda3-4.4.0-Windows-x86_64.sh) from here.
I confirmed the conda installation by: conda -V
It should give you: conda 4.3.21
I confirmed the python installation by: python -V
It should give you: Python 3.6.1 :: Anaconda 4.4.0 (64-bit)
Confirm the conda environment by typing on anaconda prompt:
conda update conda
conda update anaconda
Next, I Installed theano by: conda install theano
Next, I installed tensorflow by: conda install -c conda-forge tensorflow
Last, I installed keras by: pip install keras
This process takes some while.
The latest Tensorflow 1.12 supports python 3.4,3.5 or 3.6.
python 3.7 is not supported.
you can download Anaconda 5.2.0
After the Anaconda is installed, you can use conda install tensorflow or conda install tensorflow-gpu to quickly install tensorflow

How to upgrade scikit-learn package in anaconda

I am trying to upgrade package of scikit-learn from 0.16 to 0.17. For that I am trying to use binaries from this website: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn. I have Windows 7 x64 bit. I downloaded the relevant package locally and gave following commands and got Requirement already up-to-date:
C:\Users\skumar>pip install --upgrade --use-wheel --no-index --find-links=../../
SOURCE/APPS scikit-learn
Ignoring indexes: https://pypi.python.org/simple
Requirement already up-to-date: scikit-learn in c:\anaconda3\lib\site-packages
Then I tried to upgrade it from remote site and got similar result:
C:\Users\skumar>pip install --upgrade --use-wheel --no-index --trusted-host www.
lfd.uci.edu --find-links=http://www.lfd.uci.edu/~gohlke/pythonlibs/ scikit-learn
Ignoring indexes: https://pypi.python.org/simple
Requirement already up-to-date: scikit-learn in c:\anaconda3\lib\site-packages
On Remote site there are two versions i.e., 0.16 & 0.17. Is there a way to specify version in command? Or how do you install/upgrade wheel file?
Anaconda comes with the conda package manager which is designed to handle these kinds of upgrades. Start by updating conda itself to get the most recent package lists:
conda update conda
And then install the version of scikit-learn you want
conda install scikit-learn=0.17
All necessary dependencies will be upgraded as well. If you have trouble with conda on Windows, there are some relevant FAQ here: http://docs.continuum.io/anaconda/faq
Following Worked for me for scikit-learn on Anaconda-Jupyter Notebook.
Upgrading my scikit-learn from 0.19.1 to 0.19.2 in anaconda installed on Ubuntu on Google VM instance:
Run the following commands in the terminal:
First, check existing available packages with versions by using:
conda list
It will show different packages and their installed versions in the output. Here check for scikit-learn. e.g. for me, the output was:
scikit-learn 0.19.1 py36hedc7406_0
Now I want to Upgrade to 0.19.2 July 2018 release i.e. latest available version.
conda config --append channels conda-forge
conda install scikit-learn=0.19.2
As you are trying to upgrade to 0.17 version try the following command:
conda install scikit-learn=0.17
Now check the required version of the scikit-learn is installed correctly or not by using:
conda list
For me the Output was:
scikit-learn 0.19.2 py36_blas_openblasha84fab4_201 [blas_openblas] conda-forge
Note: Don't use pip command if you are using Anaconda or Miniconda
I tried following commands:
!conda update conda
!pip install -U scikit-learn
It will install the required packages also will show in the conda list but if you try to import that package it will not work.
On the website http://scikit-learn.org/stable/install.html it is mentioned as:
Warning To upgrade or uninstall scikit-learn installed with Anaconda or conda you should not use the pip.
So to upgrade scikit-learn package, you have to follow below process
Step-1: Open your terminal(Ctrl+Alt+t)
Step-2: Now for checking currently installed packages along with the
versions installed on your
conda environment by typing conda list
Step-3: Now for upgrade type below command
conda update scikit-learn
Hope it helps!!
I would suggest using conda. Conda is an anconda specific package manager. If you want to know more about conda, read the conda docs.
Using conda in the command line, the command below would install scipy 0.17.
conda install scipy=0.17.0
Updating a Specific Library - scikit-learn:
Anaconda (conda):
conda install scikit-learn
Pip Installs Packages (pip):
pip install --upgrade scikit-learn
Verify Update:
conda list scikit-learn
It should now display the current (and desired) version of the scikit-learn library.
For me personally, I tried using the conda command to update the scikit-learn library and it acted as if it were installing the latest version to then later discover (with an execution of the conda list scikit-learn command) that it was the same version as previously and never updated (or recognized the update?). When I used the pip command, it worked like a charm and correctly updated the scikit-learn library to the latest version!
Hope this helps!
More in-depth details of latest version can be found here (be mindful this applies to the scikit-learn library version of 0.22):
Release Highlights for scikit-learn 0.22
I made it work to update to 0.24.1, on Windows 10 64bits, so I share the way I did it with the GUI:
launch Anaconda3 gui
on the left menu, click "environments"
next to "base (root)", click on the green arrow/triangle
select "Open Terminal"
type the command line:
conda install scikit-learn==0.24.1
It worked without error.
If you are using Jupyter in anaconda, after conda update scikit-learn in terminal, close anaconda and restart, otherwise the error will occur again.

Categories

Resources