I have test project that uses amqplib. It is abandoned but it is still in use. I created virtual environment for this project last year and run it on Ubuntu 18 + Python 3.8 and it works fine
Couple weeks ago I upgraded to Ubuntu 20, so this venv stopped working. I decided to create new venv. Project was installed successfully but during run I got
from amqplib.client_0_8.basic_message import Message
File "<PATH_TO_MY_VENV>/lib/python3.8/site-packages/amqplib/client_0_8/__init__.py", line 24, in <module>
from basic_message import *
ModuleNotFoundError: No module named 'basic_message'
I tried it in separate project, just installing amqplib (tried both, using Pyharm GUI and using "pip install amqplib" command)
Tried both these imports, they give the same error:
import amqplib.client_0_8 as amqp # as in example in official repository https://github.com/barryp/py-amqplib/blob/master/demo/demo_receive.py
from amqplib import client_0_8 as amqp # as in my project
Tried it on this environments, also the same result:
- Ubuntu20 + Python 3.9.16
- Ubuntu20 + Python 3.8.16
- Windows10 + Python 3.11
Traceback (most recent call last):
File "<PATH_TO_PROJECT>/amqp_test/sample.py", line 11, in <module>
import amqplib.client_0_8 as amqp # as in doc
File "<PATH_TO_PROJECT>/amqp_test/venv/lib/python3.9/site-packages/amqplib/client_0_8/__init__.py", line 24, in <module>
from basic_message import *
ModuleNotFoundError: No module named 'basic_message'
My colleague installed it early on Ubuntu 20 and doesn't have such error.
It could be fixed by updating code inside amqplib package, by changing import statements, but it is not the way I expect and it worked previously without such updates.
Do you have any ideas how it can be fixed?