Unable to load pyro

Hi,
I am trying to set up pyro on a Gentoo python (v. 3.5.5) install.
I have set up pip, and installed numpy, scipy, torch, torchvision
and pyro-ppl using pip3.
Then, when I start python3, and attempt to load pyro, I get the
following error:
$ python3
Python 3.5.5 (default, Apr 19 2018, 11:50:47)
[GCC 6.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import torch
import pyro
Traceback (most recent call last):
File “”, line 1, in
File “/media/share/python/pyro.py”, line 3, in
import pyro.distributions as dist
ImportError: No module named ‘pyro.distributions’; ‘pyro’ is not a package
import pyro.distributions as dist
Traceback (most recent call last):
File “”, line 1, in
File “/media/share/python/pyro.py”, line 3, in
import pyro.distributions as dist
ImportError: No module named ‘pyro.distributions’; ‘pyro’ is not a package

Not sure what I am doing wrong. Any idea ?

can you paste the output of pip freeze? or specifically pip freeze | grep pyro-ppl? are you using an environment manager like conda/virtualenv ?

Thanks!

I have done all the installs using pip, rather than conda. I understood it was possible to do all with pip, (maybe I am wrong), and my feeling is that it is better to use a single system so as to keep everything consistent.

Here is the output of pip freeze:

$ pip3 freeze
certifi==2017.4.17
contextlib2==0.5.5
cracklib==2.9.6
Cython==0.25.2
decorator==4.3.0
docutils==0.13.1
file-magic==0.3.0
gdbus-codegen==2.52.3
gentoolkit==0.4.0
gpg==1.10.0
graphviz==0.8.3
meld==3.18.0
meson==0.45.1
networkx==2.1
numpy==1.10.4
Pillow==5.1.0
portage==2.3.24
pyblake2==1.1.0
pycairo==1.16.3
pycryptsetup==1.7.5
pyelftools==0.24
Pygments==2.2.0
pygobject==3.24.1
pyparsing==2.2.0
pyro-ppl==0.2.0
pyxattr==0.5.5
six==1.11.0
torch==0.4.0
torchvision==0.2.1

There’s a suspicious pyro.py in your filesystem. Did you happen to write an example pyro model in a file named pyro.py? If so you should be able to simply rename that file and the correct pyro package should be found.

Thanks, indeed, this was the issue!