Search code examples
pythonpycharmpython-module

Failing to import module named 'version' because izip_longest


I'm trying to import a module named version, but every time I try to import it, I got these errors:

  from version import __version__
       ModuleNotFoundError: No module named 'version'

  from itertools import izip_longest
        ImportError: cannot import name 'izip_longest' from 'itertools' (unknown location)

Failed to install package 'version'

I checked this thread and the accepted answer shows that izip_longest was renamed to zip_longest and that's why I can't import the module 'version'

Is there any way to get around this problem and import the module version in PyCharm?


Solution

  • Version 0.1.1 of version released on PyPI is not compatible with Python 3. The latest Github version is, but has not been released as its own version on PyPI yet. You'll have to explicitly install the Github version; on the command line that'd be:

    pip install git+https://github.com/keleshev/version.git
    

    Overall, that package looks pretty dead, and you may be better off looking for a maintained package that does the same thing.