irmen / Pyro5

Pyro 5 - Python remote objects
https://pyro5.readthedocs.io
MIT License
305 stars 36 forks source link

Cannot import freshly pip-installed Pyro5 #33

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello,

Installing Pyro5 from via pip for python3.8 seems to be broken. Here's what's happening:

Installing pyro:

$ pip3 install Pyro5
Collecting Pyro5
  Using cached Pyro5-5.11-py3-none-any.whl (77 kB)
Requirement already satisfied: serpent>=1.27 in ./.local/lib/python3.8/site-packages (from Pyro5) (1.30.2)
Installing collected packages: Pyro5
Successfully installed Pyro5-5.11

Launching a python shell and importing the server module:

$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Pyro5.server
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bla/.local/lib/python3.8/site-packages/Pyro5/server.py", line 20, in <module>
    from . import config, core, errors, serializers, socketutil, protocol, client
  File "/home/bla/.local/lib/python3.8/site-packages/Pyro5/core.py", line 15, in <module>
    from . import config, errors, socketutil, serializers, nameserver
  File "/home/bla/.local/lib/python3.8/site-packages/Pyro5/nameserver.py", line 269, in <module>
    @server.expose
AttributeError: partially initialized module 'Pyro5.server' has no attribute 'expose' (most likely due to a circular import)
>>> 

The docs state that a pip install should just work, so I am not sure how to continue here. The OS is Ubuntu20.04.

I would be grateful for any ideas. It could very well be that the system is configured incorrectly somehow, and Pyro5 is not at fault.

irmen commented 3 years ago

As a workaround, try importing Pyro5.core before Pyro5.server or stick to the exported things in Pyro5.api.

The fix will be available in the next release 5.12