mosquito / aiormq

Pure python AMQP 0.9.1 asynchronous client library
Other
259 stars 56 forks source link

No attribute named 'spec' #101

Open leveraction opened 3 years ago

leveraction commented 3 years ago

I am new to this library and cut-and-pasted one of the tutorial examples. https://github.com/mosquito/aiormq#id22
When attempting to run this code I get "AttributeError: module 'aiormq' has no attribute 'spec'" Is the documentation lagging behind the code or am I missing something else? Thanks.

leveraction commented 3 years ago

Solved. I use PyCharm and imported the library using Poetry. The IDE reports that I am using version 4.0.1. In the aiormq/__init__.py file in my copy, the line from pamqp import commands as spec was not included at the top of the file. Also, "spec", must be added into the contents of the __all__ variable on (around line 62 in the original). That fixed it for me.

mosquito commented 3 years ago

4.x.x branch is unstable now. Sorry for no mensions.