0

A while ago, I created a virtual environment to work with the Python tensorflow library on Bash on Ubuntu on Windows.

When using pip3 list within that environment, I can see that version 1.1.0 of tensorflow is installed. In the mean time, tensorflow 1.5 has already been released.

I'm trying to update the tensorflow library to the new version with pip3 install tensorflow. But I'm only getting the message "Requirement already satisfied".

How do I upload tensorflow (and my other libraries, for which the same thing happens) to the newest version in this environment?

Johanna
  • 1,019
  • 2
  • 9
  • 20
  • 1
    `pip3 install --upgrade tensorflow==1.5` – Igor Lavrynenko Feb 28 '18 at 10:19
  • 1
    You don't need the `=1.5` since the question is how to update to the **newest** version – FlyingTeller Feb 28 '18 at 10:20
  • Thanks, it's working! And how could I upgrade all libraries at once, without specifying their names? – Johanna Feb 28 '18 at 10:21
  • 1
    You may wish to follow the idea of using virtual environments in python (the module is venv). If you update all packages older projects may break in the future, if you're currently not using virtual environments you update that package for all applications – user5823815 Mar 05 '18 at 23:50

1 Answers1

2

From this question I use the following python script:

import pip
import subprocess
for dist in pip.get_installed_distributions():
    if 'site-packages' in dist.location:
        try:
            subprocess.call(['pip3', 'install', '-U', dist.key])
            print("updated " + dist.key)
        except Exception as exc:
            print(exc)

call it with python3 and it should upgrade all your packages that need updating. There are other alternatives there that you might want to check out as well.

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53