How to Solve Error Message Unable to create process using ‘python.exe -V’

Posted on

Introduction

This article will present the content for solving a specific error message. That error message appear upon executing a specific command in a python virtual environment. The following is the sequence of action which is leading on to the error message occurrence :

  1. In the first step, it is a step just for executing Command Prompt using a normal user account :

    Microsoft Windows [Version 10.0.22000.795]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\Personal User>
    
  2. Next step, executing the python command just to check the version of it :

    C:\Users\Personal User>python
    Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> quit
    Use quit() or Ctrl-Z plus Return to exit
    >>> quit()
    
    C:\Users\Personal User>python -V
    Python 3.10.5
    
    C:\Users\Personal User>
    

    The above steps are just series of steps for checking the version of the python exist in the operating system.

So, the output above is certainly showing the version of the python exist in the operating system. That python has the version of ‘3.10.5’. The following one is the steps where the process for creating the python virtual environment exist :

  1. The first attempt is the attempt to continue on the above step using the Command Prompt and direct it to the Django project directory as follows :

    Microsoft Windows [Version 10.0.22000.795]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\Personal User>python -V
    Python 3.10.5
    
    C:\Users\Personal User>cd \
    
    C:\>cd repository
    
    C:\repository\>cd django
    
    C:\repository\django>
    
  2. In the command prompt, execute the following command to create a python virtual environment as the execution below :

     
    C:\repository\django>virtualenv env 
    created virtual environment CPython3.9.10.final.0-64 in 3264ms 
      creator CPython3Windows(dest=C:\repository\django\env, clear=False, no_vcs_ignore=False, global=False) 
      seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Personal User\AppData\Local\pypa\virtualenv) 
        added seed packages: pip==22.1.2, setuptools==62.5.0, wheel==0.37.1 
      activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator 
    C:\repository\office\django>
    
  3. Following after, just get in to the python virtual environment directory as exist below :

    C:\repository\office\django>cd env 
    C:\repository\office\django\env>dir 
    Volume in drive C is Windows-SSD 
    Volume Serial Number is CA30-19A4 
    
    Directory of C:\repository\office\django\env 
    
    07/17/2022 08:32 AM    <DIR>      . 
    07/17/2022 08:32 AM    <DIR>      .. 
    07/17/2022 08:32 AM            42 .gitignore 
    07/17/2022 08:32 AM    <DIR>      bin 
    07/17/2022 08:32 AM    <DIR>      lib 
    07/17/2022 08:32 AM           298 pyvenv.cfg 
                 2 File(s) 340 bytes 
                 4 Dir(s) 147,230,982,144 bytes free
     
    C:\repository\office\django\env>cd bin
    
  4. Continue on the above step, just execute the following command to activate the python virtual environment :

    C:\repository\office\django\env\bin>activate 
    
    (env) C:\repository\office\django\env\bin>python -V 
    Python 3.9.10 
    
    (env) C:\repository\office\django\env\bin>
    

Following after, is the process below are the processes for executing a specific command where it trigger the actual error message :

  1. Following another step, just execute the Command Prompt using an ‘Administrator’ account just to make sure the python command is a available :

    Microsoft Windows [Version 10.0.22000.795]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>cd \
    
    C:\>cd repository
    
    C:\repository>
    
    C:\repository>cd django
    
    C:\repositorydjango>
    
    C:\repository\office\django>cd env
    
    C:\repository\office\djangoenv>cd Scripts
    
    C:\repository\office\django\env\Scripts>dir
     Volume in drive C is Windows-SSD
     Volume Serial Number is CA30-19A4
    
     Directory of C:\repository\office\django\env\Scripts
    
    07/14/2022 01:04 PM <DIR>        . 
    07/14/2022 01:04 PM <DIR>        .. 
    07/14/2022 01:04 PM              2,158 activate 
    07/14/2022 01:04 PM                998 activate.bat 
    07/14/2022 01:04 PM              3,035 activate.fish 
    07/14/2022 01:04 PM              2,589 activate.nu 
    07/14/2022 01:04 PM              1,758 activate.ps1 
    07/14/2022 01:04 PM              1,193 activate_this.py 
    07/14/2022 01:04 PM                510 deactivate.bat 
    07/14/2022 01:04 PM                682 deactivate.nu 
    07/14/2022 01:04 PM            106,877 pip-3.10.exe 
    07/14/2022 01:04 PM            106,877 pip.exe 
    07/14/2022 01:04 PM            106,877 pip3.10.exe 
    07/14/2022 01:04 PM            106,877 pip3.exe 
    07/14/2022 01:04 PM                 24 pydoc.bat 
    07/14/2022 01:04 PM            264,176 python.exe 
    07/14/2022 01:04 PM            252,912 pythonw.exe 
    07/14/2022 01:04 PM            106,864 wheel-3.10.exe 
    07/14/2022 01:04 PM            106,864 wheel.exe 
    07/14/2022 01:04 PM            106,864 wheel3.10.exe 
    07/14/2022 01:04 PM            106,864 wheel3.exe 
                 19 File(s) 1,384,999 bytes 
                  2 Dir(s) 150,664,065,024 bytes free 
    C:\repository\office\django\env\Scripts>
    
  2. C:\repository\office\django\api\env\Scripts>activate
    (env) C:\repository\office\django\api\env\Scripts>python -V
    Unable to create process using 'C:\Users\Personal User\AppData\Local\Programs\Python\Python310\python.exe -V'
    
    (env) C:\repository\office\django\api\env\Scripts>
    

How to Solve Error Message Unable to create process using ‘python.exe’

Basically, the solution to solve the problem is quite easy. After searching the solutions where there are several of them exist all over the web using the google search, there is one significant solution. That solution is just by uninstalling python and also the python launcher exist in the operating system. So, the following is the steps to accomplish that :

  1. First of all, just uninstall the existing python available in the operating system. Just look at the article with the title of ‘How to Uninstall Python in Microsoft Windows’ in this link as a reference.

  2. Next, after successfully uninstalling python, just continue on the next process. It is the uninstallation python launcher where it exist in an article in this link with the title of ‘How to Uninstall Python Launcher in Microsoft Windows’.

  3. Another one after, just install the fresh or the newly python in the operating system. It exist in an article exist in this link with the title of ‘How to Install Python 3.10 in Microsoft Windows’.
  4. Finally, just create the new python environment variable. But do not use the ‘virtualenv’ command. Instead, use the ‘python -m venv env’ as follows :
    C:\repository\django>python -m venv venv
    
    C:\repository\django>cd venv
    
    (venv) C:\repository\django\venv>dir
    Volume in drive C is Windows-SSD
    Volume Serial Number is CA30-19A4
    
    Directory of C:\repository\django\venv
    
    07/17/2022 03:08 PM <DIR> .
    07/17/2022 03:08 PM <DIR> ..
    07/17/2022 03:08 PM <DIR> Include
    07/17/2022 03:08 PM <DIR> Lib
    07/17/2022 03:08 PM 84 pyvenv.cfg
    07/17/2022 03:08 PM <DIR> Scripts
    1 File(s) 84 bytes
    5 Dir(s) 147,161,825,280 bytes free
    
    C:\repository\django\venv>
    
    C:\repository\django\venv>cd Scripts
    
    C:\repository\django\venv\Scripts>dir
    Volume in drive C is Windows-SSD
    Volume Serial Number is CA30-19A4
    
    Directory of C:\repository\django\venv\Scripts
    
    07/17/2022 03:08 PM <DIR> .
    07/17/2022 03:08 PM <DIR> ..
    07/17/2022 03:08 PM 2,072 activate
    07/17/2022 03:08 PM 1,001 activate.bat
    07/17/2022 03:08 PM 22,159 Activate.ps1
    07/17/2022 03:08 PM 393 deactivate.bat
    07/17/2022 03:08 PM 106,362 pip.exe
    07/17/2022 03:08 PM 106,362 pip3.10.exe
    07/17/2022 03:08 PM 106,362 pip3.exe
    07/17/2022 03:08 PM 264,176 python.exe
    07/17/2022 03:08 PM 252,912 pythonw.exe
    9 File(s) 861,799 bytes
    2 Dir(s) 147,161,825,280 bytes free
    
    C:\repository\django\venv\Scripts>cd ..
    
    C:\repository\django\venv\Scripts>activate
    
    (venv) C:\repository\django\venv\Scripts>python -V
    Python 3.10.5
    
    (venv) C:\repository\django\venv\Scripts>
    

    At last, executing the ‘python’ is possible inside the python virtual environment where it currently active. So, the problem is solved.

 

Leave a Reply