Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
930 views
in Technique[技术] by (71.8m points)

tensorflow2.0 - Issues Installing Tensorflow Probability

Error

When I attempt to import Tensorflow probability:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-a01afb2be6d3> in <module>
      7 import PIL
      8 import tensorflow as tf
----> 9 import tensorflow_probability as tfp
     10 import time

ModuleNotFoundError: No module named 'tensorflow_probability'

What I've tried

pip list

The output is:

Package                  Version
------------------------ ----------------------------------------------
absl-py                  0.10.0
astor                    0.8.1
astroid                  2.2.5
astunparse               1.6.3
attrs                    20.3.0
cachetools               4.1.1
certifi                  2020.11.8
chardet                  3.0.4
cloudpickle              1.6.0
dataclasses              0.8
decorator                4.4.2
dill                     0.3.3
Django                   2.2.4
dm-sonnet                1.23
dm-tree                  0.1.5
future                   0.18.2
gast                     0.3.3
google-auth              1.23.0
google-auth-oauthlib     0.4.2
google-pasta             0.2.0
googleapis-common-protos 1.52.0
grpcio                   1.34.0
h5py                     2.10.0
idna                     2.10
imageio                  2.9.0
importlib-metadata       3.1.1
importlib-resources      3.3.0
isort                    4.3.20
Keras-Preprocessing      1.1.2
lazy-object-proxy        0.0.0
Markdown                 3.3.3
mccabe                   0.6.1
numpy                    1.18.5
oauthlib                 3.1.0
opt-einsum               3.3.0
Pillow                   8.0.1
pip                      20.3.3
promise                  2.3
protobuf                 3.14.0
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pylint                   2.3.1
pytz                     2019.2
PyYAML                   5.3.1
requests                 2.25.0
requests-oauthlib        1.3.0
rsa                      4.6
setuptools               50.3.2
six                      1.12.0
sqlparse                 0.3.0
tensorboard              2.4.0
tensorboard-plugin-wit   1.7.0
tensorflow               2.3.1
tensorflow-docs          0.0.04961914175b6837d95ca793f3541bdfe7420033f-
tensorflow-estimator     2.3.0
tensorflow-metadata      0.25.0
tensorflow-probability   0.11.1
termcolor                1.1.0
tfp-nightly              0.12.0.dev20201221
tqdm                     4.54.1
typed-ast                1.3.5
typing-extensions        3.7.4.3
urllib3                  1.26.2
Werkzeug                 1.0.1
wheel                    0.36.1
wrapt                    1.11.1
zipp                     3.4.0

I have tried uninstalling and using sudo variants for the install commands but I still get this import error. Additionally, I have tried the fixes found at https://github.com/deepmind/graph_nets/issues/3 as seen in the output of pip list. I have also tried the fix offered at No module named 'tensorflow_probability'. Can someone help me get this working?

I am using Python v 3.8.5 interpreter in VS Code. My OS is Mac OS Sierra v 10.12.6.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...