diff --git a/news/5021.bugfix b/news/5021.bugfix index 4de60b18e76..36606fd20f5 100644 --- a/news/5021.bugfix +++ b/news/5021.bugfix @@ -1 +1 @@ -Package name should be normalized before we use it to search if it's already installed or not +Use canonical package names while looking up already installed packages. diff --git a/src/pip/_internal/commands/search.py b/src/pip/_internal/commands/search.py index c01d96a2473..e906ce7667f 100644 --- a/src/pip/_internal/commands/search.py +++ b/src/pip/_internal/commands/search.py @@ -19,7 +19,6 @@ from pip._internal.network.xmlrpc import PipXmlrpcTransport from pip._internal.utils.compat import get_terminal_size from pip._internal.utils.logging import indent_log - from pip._internal.utils.misc import get_distribution, write_output from pip._internal.utils.typing import MYPY_CHECK_RUNNING @@ -32,7 +31,6 @@ {'name': str, 'summary': str, 'versions': List[str]}, ) - logger = logging.getLogger(__name__) diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index 2aa853642c5..644930a1528 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -429,7 +429,6 @@ def check_if_exists(self, use_user_site): """ if self.req is None: return - # get_distribution() will resolve the entire list of requirements # anyway, and we've already determined that we need the requirement # in question, so strip the marker so that we don't try to