Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pip install" does not operate if "pip uninstall" has been invoked previously. #11121

Closed
1 task done
RokeJulianLockhart opened this issue May 14, 2022 · 5 comments
Closed
1 task done
Labels
resolution: invalid Invalid issue/PR

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented May 14, 2022

"x" is "pmbootstrap" or "tg", and "pip" is obviously "pip3" or "pip".

Description

I believe that "http://github.com/paul-nameless/tg/issues/275#issuecomment-1126788158" explains well that the executable file that "pip install x" should create the whenever "pip install x" is invoked is not created during the 2nd invocation of "pip install x".

Expected behavior

The executable file that "pip install x" should create the whenever "pip install x" is invoked should be created during the 2nd invocation of "pip install x".

pip version

"22.0.4."

Python version

"3.10.4".

OS

"Linux BEEDELLROKEJULIANLOCKHART 5.18.0-0.rc6.20220511gitfeb9c5e19e913b5.50.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 11 15:10:58 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux".

"http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/iso/" installs it.

How to Reproduce

  1. Execute "pip install x".
  2. Execute "pip uninstall x".
  3. Execute "x".

Output

"http://github.com/paul-nameless/tg/issues/275#issuecomment-1126788158":

[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART /]$ su
[root@BEEDELLROKEJULIANLOCKHART /]# script -a
Script started, output log file is 'typescript'.
[root@BEEDELLROKEJULIANLOCKHART /]# pip uninstall tg
Found existing installation: tg 0.19.0
Uninstalling tg-0.19.0:
  Would remove:
    /usr/local/bin/tg
    /usr/local/lib/python3.10/site-packages/tg-0.19.0.dist-info/*
    /usr/local/lib/python3.10/site-packages/tg/*
Proceed (Y/n)? Y
  Successfully uninstalled tg-0.19.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@BEEDELLROKEJULIANLOCKHART /]# exit
exit
Script done.
[root@BEEDELLROKEJULIANLOCKHART /]# exit
exit
[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART /]$ pip install tg
Defaulting to user installation because normal site-packages is not writeable
Collecting tg
  Downloading tg-0.19.0-py3-none-any.whl (73 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.6/73.6 KB 144.2 kB/s eta 0:00:00
Requirement already satisfied: python-telegram==0.15.0 in /usr/local/lib/python3.10/site-packages (from tg) (0.15.0)
Installing collected packages: tg
Successfully installed tg-0.19.0
[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART /]$ pip uninstall tg
Found existing installation: tg 0.19.0
Uninstalling tg-0.19.0:
  Would remove:
    /home/BEEDELLROKEJULIANLOCKHART/.local/bin/tg
    /home/BEEDELLROKEJULIANLOCKHART/.local/lib/python3.10/site-packages/tg-0.19.0.dist-info/*
    /home/BEEDELLROKEJULIANLOCKHART/.local/lib/python3.10/site-packages/tg/*
Proceed (Y/n)? Y
  Successfully uninstalled tg-0.19.0
[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART /]$ pip3 install tg
Defaulting to user installation because normal site-packages is not writeable
Collecting tg
  Using cached tg-0.19.0-py3-none-any.whl (73 kB)
Requirement already satisfied: python-telegram==0.15.0 in /usr/local/lib/python3.10/site-packages (from tg) (0.15.0)
Installing collected packages: tg
Successfully installed tg-0.19.0
[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART /]$ tg
bash: /usr/local/bin/tg: No such file or directory
[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART /]$

"http://gitlab.com/postmarketOS/pmbootstrap/-/issues/2127":

pip3 install pmbootstrap
Defaulting to user installation because normal site-packages is not writeable
Collecting pmbootstrap
  Downloading pmbootstrap-1.43.0-py3-none-any.whl (238 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 238.1/238.1 KB 3.1 MB/s eta 0:00:00
Installing collected packages: pmbootstrap
Successfully installed pmbootstrap-1.43.0
[BEEDELLROKEJULIANLOCKHART@BEEDELLROKEJULIANLOCKHART ~]$ pmbootstrap init
bash: /usr/bin/pmbootstrap: No such file or directory

Code of Conduct

@RokeJulianLockhart RokeJulianLockhart added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels May 14, 2022
@RokeJulianLockhart RokeJulianLockhart changed the title "pip install" is inoperative if "pip uninstall" has been invoked previously. "pip install" does not operate if "pip uninstall" has been invoked previously. May 14, 2022
@notatallshaw
Copy link
Member

Can't reproduce in a virtual environment on a non-root user using Pyhon 3.10.4 with Pip 22.1.1:

(.venv) damian@You-Are-My-Sunshine:~/uninstall_test$ pip install tg
Collecting tg
  Downloading tg-0.19.0-py3-none-any.whl (73 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.6/73.6 kB 3.0 MB/s eta 0:00:00
Collecting python-telegram==0.15.0
  Downloading python-telegram-0.15.0.tar.gz (14.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.9/14.9 MB 7.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for python-telegram, since package 'wheel' is not installed.
Installing collected packages: python-telegram, tg
  Running setup.py install for python-telegram ... done
Successfully installed python-telegram-0.15.0 tg-0.19.0

(.venv) damian@You-Are-My-Sunshine:~/uninstall_test$ tg
Enter your phone number in international format (including country code)
phone> 

(.venv) damian@You-Are-My-Sunshine:~/uninstall_test$ pip uninstall tg
Found existing installation: tg 0.19.0
Uninstalling tg-0.19.0:
  Would remove:
    /home/damian/uninstall_test/.venv/bin/tg
    /home/damian/uninstall_test/.venv/lib/python3.10/site-packages/tg-0.19.0.dist-info/*
    /home/damian/uninstall_test/.venv/lib/python3.10/site-packages/tg/*
Proceed (Y/n)? Y
  Successfully uninstalled tg-0.19.0
 
(.venv) damian@You-Are-My-Sunshine:~/uninstall_test$ tg
-bash: /home/damian/uninstall_test/.venv/bin/tg: No such file or directory

(.venv) damian@You-Are-My-Sunshine:~/uninstall_test$ pip install tg
Collecting tg
  Using cached tg-0.19.0-py3-none-any.whl (73 kB)
Requirement already satisfied: python-telegram==0.15.0 in ./.venv/lib/python3.10/site-packages (from tg) (0.15.0)
Installing collected packages: tg
Successfully installed tg-0.19.0

(.venv) damian@You-Are-My-Sunshine:~/uninstall_test$ tg
Enter your phone number in international format (including country code)
phone>

@uranusjr
Copy link
Member

This is most likely due to the second pip install installs to the user-site (at ~/.local), not the global site (at /usr/local). You probably need to run rehash to update the command cache.

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2022
@uranusjr uranusjr added resolution: invalid Invalid issue/PR and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels May 23, 2022
@RokeJulianLockhart
Copy link
Author

@uranusjr, if this issue described what is known to be erroneous, and requires subsequent triage, why has it been closed; is that status temporary?

@uranusjr
Copy link
Member

It’s not errorneous and likely out of pip’s control. It is always possible to reopen if further evidence proves the previous judgement was incorrect.

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented May 23, 2022

@uranusjr, I misread the notification. I thought that you added the labels that you removed. I am thankful for your explanation anyway.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: invalid Invalid issue/PR
Projects
None yet
Development

No branches or pull requests

3 participants