Skip to content

msgpack.version gives attribute error #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aqeelat opened this issue Aug 18, 2022 · 4 comments
Closed

msgpack.version gives attribute error #516

aqeelat opened this issue Aug 18, 2022 · 4 comments

Comments

@aqeelat
Copy link

aqeelat commented Aug 18, 2022

#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
Copy link
Author

aqeelat commented Aug 18, 2022

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
Copy link
Member

methane commented Aug 22, 2022

#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
Copy link
Author

aqeelat commented Aug 23, 2022

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
Copy link
Author

aqeelat commented Aug 23, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants