Skip to content

msgpack.version gives attribute error #516

Description

@aqeelat

#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)

Activity

  1. aqeelat commented on Aug 18, 2022

    @aqeelat
    Author

    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'])}
    
  2. methane commented on Aug 22, 2022

    @methane
    Member

    #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)
    
  3. aqeelat commented on Aug 23, 2022

    @aqeelat
    Author

    that's really weird. I just tried a fresh venv and you're right. It worked.
    Why would it fail at my previous venv?

  4. aqeelat commented on Aug 23, 2022

    @aqeelat
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions