Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module 'pip._internal.download' has no attribute 'is_file_url'

Tags:

python

pip

after upgrade to pip-19.3.1

 pip-compile requirements.in
Traceback (most recent call last):
  File "/usr/local/bin/pip-compile", line 7, in <module>
    from piptools.scripts.compile import cli
  File "/usr/local/lib/python3.6/dist-packages/piptools/scripts/compile.py", line 11, in <module>
    from .._compat import install_req_from_line, parse_requirements
  File "/usr/local/lib/python3.6/dist-packages/piptools/_compat/__init__.py", line 7, in <module>
    from .pip_compat import (
  File "/usr/local/lib/python3.6/dist-packages/piptools/_compat/pip_compat.py", line 32, in <module>
    is_file_url = do_import("download", "is_file_url")
  File "/usr/local/lib/python3.6/dist-packages/piptools/_compat/pip_compat.py", line 24, in do_import
    return getattr(imported, package)
AttributeError: module 'pip._internal.download' has no attribute 'is_file_url'
like image 992
Ryabchenko Alexander Avatar asked Dec 25 '19 12:12

Ryabchenko Alexander


1 Answers

pip-compile and the pip-tools package that provide it might sound like actual parts of pip, but they're actually third-party things that abuse the pip internals in ways that are explicitly unsupported and subject to no backward compatibility guarantees.

That means that whenever pip itself gets a new version, there's a pretty decent chance that pip-tools and pip-compile (and anything else that reaches into pip's guts) will abruptly stop working until the pip-tools developers adjust things. When that happens, you have to update pip-tools (if a fix is available), downdate pip (if pip-tools doesn't have a fix available yet), or just stop using pip-tools.

like image 144
user2357112 supports Monica Avatar answered Oct 04 '22 04:10

user2357112 supports Monica