Python Forum
pip stops waiting for python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip stops waiting for python
#1
Hello everyone,

My name is Ignazio and I have just joined the forum, I am a retired computer scientist and I have worked mainly on Unix systems programming in 'C'. I installed Python both on a Fedora 39 Linux server and on my Windows 10 Pro notebook. The latter choice mainly serves as a study environment, reserving the actual development on the Linux machine.

I chose to install and use Python to develop some home automation projects, both for the control part and for the interface part with the help of pyqt6.

The installation and testing on the Linux system was perfect, everything works properly.

This was not the case for the Windows system, where: after the installation of Python 3.12 was successfully completed, I opened a cmd window and tried the usual command:

C:\users\walker> python --version # receiving the correct output
Python 3.12.0

Similarly I tried with the command:

C:\users\walker> pip --version # pip gets stuck waiting

I analyze with the task manager and find pip waiting, viewing the waiting chain, it tells me that it is waiting for python.

At this point all I had to do was terminate the blocking python process and immediately afterwards pip released control without producing the usual output.

I wanted to bring this anomalous behavior to your attention, hoping that you can help me solve the problem.
Attached is the image of the Windows task manager.

Thanks, see you soon
Ignazio

Attached Files

Thumbnail(s)
   
Reply
#2
pip.exe is waiting for another process python.exe to finish.
This can happen if python.exe is currently running or using a file that pip needs to access.

Try to do this in cmd see if something change change,also try this after new restart of Pc.
If python.exe still run as process after restart,then something is starting it.
python -m pip --version
where pip # This should point to root python ...Scripts folder
Look at running python.exe in task manager where is placed Path on file system.
There should be no need for python.exe to run as process long time,if not program requires this.
Reply
#3
(Nov-26-2023, 07:10 PM)snippsat Wrote: pip.exe is waiting for another process python.exe to finish.
This can happen if python.exe is currently running or using a file that pip needs to access.

Try to do this in cmd see if something change change,also try this after new restart of Pc.
If python.exe still run as process after restart,then something is starting it.
python -m pip --version
where pip # This should point to root python ...Scripts folder
Look at running python.exe in task manager where is placed Path on file system.
There should be no need for python.exe to run as process long time,if not program requires this.
---------------------------------------------------------------------------------------------------------------------------------------
pip.exe is located in the correct folder:
C:\Users\walker>where pip
C:\Users\walker\AppData\Local\Programs\Python\Python312\Scripts\pip.exe
As well as python.exe:
C:\Users\walker>where python
C:\Users\walker\AppData\Local\Programs\Python\Python312\python.exe
By starting pip.exe from the command window as usual, it remains blocked, from the task manager you can see that pip.exe is waiting for python.exe to complete a useful function for its activity, but the latter also remains stopped.
I checked carefully and there is no previously active python.exe task.
It would be ideal to be able to understand what python.exe is waiting for, to solve the problem.
Reply
#4
Do this,make a virtual environment and see if that work.
I use cmder he, but commands are just the same in cmd.
#  Make
C:\code
λ python -m venv test_env

# Cd in
C:\code
λ cd test_env\

# Activate
C:\code\test_env
λ C:\code\test_env\Scripts\activate.bat

# Test pip
C:\code\test_env
(test_env) λ pip -V
pip 23.1.2 from C:\code\test_env\Lib\site-packages\pip (python 3.11) 
As you see now run pip from this folder and not using OS Python.
So can look at option if it works like this.
Reply
#5
(Nov-27-2023, 10:44 AM)snippsat Wrote: Do this,make a virtual environment and see if that work.
I use cmder he, but commands are just the same in cmd.
#  Make
C:\code
λ python -m venv test_env

# Cd in
C:\code
λ cd test_env\

# Activate
C:\code\test_env
λ C:\code\test_env\Scripts\activate.bat

# Test pip
C:\code\test_env
(test_env) λ pip -V
pip 23.1.2 from C:\code\test_env\Lib\site-packages\pip (python 3.11) 
As you see now run pip from this folder and not using OS Python.
So can look at option if it works like this.
--------------------------------------------------------------------
The test you proposed highlighted much larger problems in my system.
I tried to create the virtual test environment, but this command also remains blocked, with four python.exe processes present in the task manager.
I assume that there may be something corrupt in the system, so before continuing to test on the python environment, I will try to remove any problems in the Windows 10 Pro operating environment.
Thanks for your suggestions, I hope to resolve it as soon as possible and if I can, I will inform you.
Reply
#6
Possible can python.exe be block bye a firewall.
Usually when install first time will a GUI window will pop-up and ask if will allow python.exe.
Type wf.msc and look at rules.
If have own security software just turn of firewall for while,and try again.
If install again can right click run as administrator,to avoid permission issues.
Reply
#7
(Nov-27-2023, 04:35 PM)snippsat Wrote: Possible can python.exe be block bye a firewall.
Usually when install first time will a GUI window will pop-up and ask if will allow python.exe.
Type wf.msc and look at rules.
If have own security software just turn of firewall for while,and try again.
If install again can right click run as administrator,to avoid permission issues.
---------------------------------------------------------------------------------------------------------------------

After the various tests that you suggested and which demonstrated that there was something strange in the system, I focused on finding some anomaly in the Windows 10 Pro environment.
1) I carried out the first check using the "sfc /scannow" command;
a. The result showed that some system files were corrupt, they were restored, but this was not enough to solve the problem.
2) I uninstalled all components of Python 3.12.0, using the "Revo Uninstaller Pro" program, which removed all elements and cleaned the registry.
3) I subsequently proceeded to restore the operating system, saving the App and Data;
4) With the system completely clean, I installed Python but not the latest release (3.12.0), but the penultimate one (3.11.6). The installation was
successful, installing all the necessary modules;
5) Using a "cmd" terminal, I executed the following commands:
C:\Users\walker> python --version
Python 3.11.6
C:\Users\walker> pip --version
pip 23.2.1 from C:\Users\walker\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
C:\root_src>python -m venv test_env
cd "C:\root_src\test_env\Scripts"
C:\root_src\test_env\Scripts>activate
(test_env) C:\root_src\test_env\Scripts>
(test_env) C:\root_src\test_env\Scripts>deactivate
C:\root_src\test_env\Scripts>

As you can see everything went fine, I will then update to the latest release.
Thank you for your assistance, which allowed me to thoroughly investigate the problem and resolve it.

Goodbye see you soon.
snippsat and Gribouillis like this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Waiting for input from serial port, then move on KenHorse 3 1,097 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  [SOLVED] [Linux] Script in cron stops after first run in loop Winfried 2 932 Nov-16-2022, 07:58 PM
Last Post: Winfried
  Waiting for heavy functions question philipbergwerf 14 3,382 Apr-29-2022, 07:31 PM
Last Post: philipbergwerf
  How to create waiting process? samuelbachorik 4 1,984 Sep-02-2021, 05:41 PM
Last Post: bowlofred
  Know when the pyttsx3 engine stops talking UsualCoder 3 3,239 Aug-29-2021, 11:08 PM
Last Post: snippsat
  Waiting and listening test 2 2,156 Nov-13-2020, 04:43 PM
Last Post: michael1789
  IDLE stops responding upon saving tompi1 2 1,946 Oct-01-2020, 05:44 PM
Last Post: Larz60+
  waiting for barcode scanner output, while main program continues to run lightframe109 3 4,665 Sep-03-2020, 02:19 PM
Last Post: DeaD_EyE
  waiting to connect Skaperen 9 3,586 Aug-17-2020, 05:58 AM
Last Post: Skaperen
  Launch another python command without waiting for a return. SpongeB0B 13 10,996 Jun-18-2020, 10:45 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020