-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Issue Description
When installing the latest amqpstorm (2.11.1) alongside pamqp>=3.0.0 (e.g., 3.3.0), an ImportError occurs. This is because pamqp renamed its specification module to commands starting from version 3.0.0, but amqpstorm still imports the old module name.
Error Message:
ImportError: cannot import name 'specification' from 'pamqp'
Root Cause
After inspecting the source code, I found that amqpstorm imports pamqp.specification in several files, such as amqpstorm/channel.py and amqpstorm/basic.py. According to the pamqp library's documentation, the public API modules were renamed in version 3.0.0:
- Old (pamqp < 3.0.0):
from pamqp import specification - New (pamqp >= 3.0.0):
from pamqp import commands
Suggested Fix
Update the import statements in amqpstorm to be compatible with the newer pamqp API. This could be done by:
- Direct update: Replace
from pamqp import specificationwithfrom pamqp import commandsin the relevant files. - Conditional import (for broader compatibility): Implement a try/except block to attempt importing the new name first, falling back to the old one. Example:
try:
from pamqp import specification
except ImportError:
from pamqp import commands as specificationMetadata
Metadata
Assignees
Labels
No labels