Probability: After installation: ModuleNotFoundError: No module named 'tensorflow_probability'

Created on 10 Jul 2018  路  3Comments  路  Source: tensorflow/probability

I got this installation issue. If anyone can help me to resolve it.

I have executed the following commands for installation:

sudo pip3 install tensorflow
sudo pip3 install --user --upgrade tfp-nightly
sudo pip3 install tensorflow-probability

Detail Error Traceback is given below

>>> import tensorflow as tf
>>> tf.__version__
'1.8.0'
>>> import tensorflow_probability as tfp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow_probability'

I'm using python 3.6, tensorflow CPU version 1.8.0, OS : Ubuntu 18.04

Any help or suggestions are highly appreciated.

Most helpful comment

Hi csuter,
Thank you for your reply and guiding me. The suggestion has been worked out for me.

All 3 comments

Hi Jalaj, I'm a bit confused by this sequence of commands. If you're using --user to install, you should use it for all the pip commands. This argument tells pip to install in a user-specific directory instead of system wide. Also, if you're using --user you don't need to run as root (sudo) since it's going to install into a directory owned by your user. Finally, it seems you're install TFP using two pip package names: tfp-nightly and tensorflow-probability. The latter isn't fully supported yet -- we're working on our first stable versioned release right now. So you'll want to avoid using that pip package for now. I'd suggest undoing those commands by running these:

# Use sudo just in case the user-local files were installed with root ownership
sudo pip3 uninstall --user tfp-nightly
sudo pip3 uninstall tensorflow-probability

Then start over with just tfp-nightly. Since you've installed tensorflow system-wide, you may want to install TFP system-wide too for consistency:

sudo pip3 install --upgrade tfp-nightly

Please give this a try and ping the thread if it doesn't work.

Hi csuter,
Thank you for your reply and guiding me. The suggestion has been worked out for me.

Great, glad it worked!

Was this page helpful?
0 / 5 - 0 ratings