msgpack.version gives attribute error
aqeelat opened this issue · 4 comments
aqeelat commented
#498 introduces a very weird behavior:
If I have:
- msgpack==1.0.3
>>> import msgpack
>>> msgpack.version
(1, 0, 3)
If I have:
- msgpack==1.0.4
>>> import msgpack
>>> msgpack.version
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'msgpack' has no attribute 'version'
but if I have:
- msgpack==1.0.4
- msgpack-python==0.5.6
>>> import msgpack
>>> msgpack.version
(1, 0, 4)
aqeelat commented
Also, with msgpack==1.04 without msgpack-python:
>>> msgpack.__dict__()
{'__name__': 'msgpack', '__doc__': None, '__package__': 'msgpack', '__loader__': <_frozen_importlib_external._NamespaceLoader object at 0x10469e4c0>, '__spec__': ModuleSpec(name='msgpack', loader=<_frozen_importlib_external._NamespaceLoader object at 0x10469e4c0>, submodule_search_locations=_NamespacePath(['/Users/aqeelat/lab/venv/lib/python3.9/site-packages/msgpack'])), '__file__': None, '__path__': _NamespacePath(['/Users/aqeelat/lab/venv/lib/python3.9/site-packages/msgpack'])}
methane commented
#498 introduces a very weird behavior:
Are you really sure? Do you double checked it on clean environment?
On my machine, msgpack==1.0.4 has msgpack.version. If #498 break msgpack.version, why I have msgpack.version?
$ venv/bin/pip install msgpack
/Users/inada-n/venv/lib/python3.10/site-packages/pip/_vendor/packaging/version.py:111: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
warnings.warn(
Collecting msgpack
Downloading msgpack-1.0.4-cp310-cp310-macosx_10_9_x86_64.whl (74 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.9/74.9 kB 911.5 kB/s eta 0:00:00
Installing collected packages: msgpack
/Users/inada-n/venv/lib/python3.10/site-packages/pip/_vendor/packaging/version.py:111: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
warnings.warn(
Successfully installed msgpack-1.0.4
$ venv/bin/python
Python 3.10.6 (main, Aug 11 2022, 13:49:25) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import msgpack
>>> msgpack.version
(1, 0, 4)
aqeelat commented
that's really weird. I just tried a fresh venv and you're right. It worked.
Why would it fail at my previous venv?
aqeelat commented
Nvm. I deleted the env and recreated it and it worked. The issue might be with ipython or jedi caching stuff.
Thank you for the reply. It really helped.