achillesrasquinha / pipupgrade

🗽 Like yarn outdated/upgrade, but for pip. Upgrade all your pip packages and automate your Python Dependency Management.

Home Page:https://git.io/pipupgrade

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update same package twice with pip and pip3

x-santiaga-x opened this issue · comments

What's the bug all about?

There is venv python environment on win32 having pip and pip3 in Scripts directory and they are the same pip.
When we run any pip command with pipupgrade, they both run and produce the same result. Therefore, packages are updated twice unnecessarily.

pip doesn't need to be used if we have found pip2 or pip3.

What command led to this issue?

pipupgrade

Logs

(build_bot) PS c:\test> pipupgrade
Checking...
2021-02-18 10:42:45,041 | INFO | Fetching installed packages for c:\test\Scripts\pip.EXE...
2021-02-18 10:42:45,042 | INFO | Fetching installed packages for c:\test\Scripts\pip3.EXE...
2021-02-18 10:42:45,042 | INFO | Executing command: c:\test\Scripts\pip.EXE list --outdated --format json
2021-02-18 10:42:45,042 | INFO | Executing command: c:\test\Scripts\pip3.EXE list --outdated --format json
2021-02-18 10:42:53,427 | INFO | 1 packages found for c:\test\Scripts\pip3.EXE.
2021-02-18 10:42:53,660 | INFO | 1 packages found for c:\test\Scripts\pip.EXE.
2021-02-18 10:42:54,724 | INFO | Initializing Package {'name': 'APScheduler', 'version': '3.6.3', 'latest_version': '3.7.0', 'latest_filetype': 'wheel'} of type <class 'dict'>...
2021-02-18 10:42:54,725 | INFO | Fetching package APScheduler information from DB...
2021-02-18 10:42:54,729 | INFO | Using cached info for package <Package APScheduler (3.6.3)>.
2021-02-18 10:42:55,070 | INFO | Initializing Package {'name': 'APScheduler', 'version': '3.6.3', 'latest_version': '3.7.0', 'latest_filetype': 'wheel'} of type <class 'dict'>...
2021-02-18 10:42:55,070 | INFO | Fetching package APScheduler information from DB...
2021-02-18 10:42:55,075 | INFO | Using cached info for package <Package APScheduler (3.6.3)>.
2021-02-18 10:42:55,130 | INFO | Packages within `pip` c:\test\Scripts\pip3.EXE found: [<Package APScheduler (3.6.3)>]...
2021-02-18 10:42:55,427 | INFO | Packages within `pip` c:\test\Scripts\pip.EXE found: [<Package APScheduler (3.6.3)>]...

Source: Installed Distributions (c:\test\Scripts\pip3.EXE)

Name        Current Version Latest Version Home Page
----------- --------------- -------------- ----------------------------------------
APScheduler 3.6.3           3.7.0          https://github.com/agronholm/apscheduler

Do you wish to update 1 package? [Y/n/q]: y
Updating 1 of 1 package: APScheduler

Source: Installed Distributions (c:\test\Scripts\pip.EXE)

Name        Current Version Latest Version Home Page
----------- --------------- -------------- ----------------------------------------
APScheduler 3.6.3           3.7.0          https://github.com/agronholm/apscheduler

Do you wish to update 1 package? [Y/n/q]: y
Updating 1 of 1 package: APScheduler

Closing as very similar to #62. Also a work around for this would be to use the --pip-path flag strictly.

The problem is not that the two pip instances are the same (this can be solved using a checksum, but somehow didn't work for me), but that they are trying to update the same location.

The solution could be pip list and pip show <first-installed-package> to get the Location string. In this way, you can define a minimal set of pip instances to update all environments.

@achillesrasquinha can you check if pip that updates the same location can be excluded from active pip's?