aiormq icon indicating copy to clipboard operation
aiormq copied to clipboard

No attribute named 'spec'

Open leveraction opened this issue 5 years ago • 2 comments

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 avatar Nov 30 '20 18:11 leveraction

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.

leveraction avatar Dec 03 '20 15:12 leveraction

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

mosquito avatar Dec 03 '20 15:12 mosquito