Skip to content

Does not work with latest pip #41

@sk-

Description

@sk-

PIP moved the apis to the _internal directory in commit 95bcf8c5f6 , so now the command fails with

Traceback (most recent call last):
  File "/Users/user/.virtualenvs/venv/bin/important", line 7, in <module>
    from important.__main__ import check
  File "/Users/user/.virtualenvs/venv/lib/python3.6/site-packages/important/__main__.py", line 12, in <module>
    from important.parse import parse_dir_imports, parse_file_imports, \
  File "/Users/user/.virtualenvs/venv/lib/python3.6/site-packages/important/parse.py", line 20, in <module>
    from pip.commands.show import search_packages_info
ModuleNotFoundError: No module named 'pip.commands'

I changed the imports to

from pip._internal.commands.show import search_packages_info
from pip._internal.req import parse_requirements as pip_parse_requirements
pip._internal.download.PipSession()

and then it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions