pythonpipmingwblendermsys

Different versions in python and no modules named pip


I put a lot of effort into this and things are even worst I am desperate as hell. Only what I wanted was to download with a pip module called PySimpleGUI and after, that things started to get worse and worse. I program plugins for blender and I wanted to execute another python file as a subprocess that needs PySimpleGUI for its running. So after the first not very successful attempt at solving the pip problem here(Why am I getting ImportError: No module named pip ' right after installing pip?), I decided to delete all the python files and versions on PC and start all over again with installing python. But even though I delete all the python files I still got a message in CMD about my version and that says my version is 3.9.10 although I installed 3.9.7. I removed all paths in env. variables and also all python folders from

C:\Users\UserName\AppData\Local\Programs

C:\Users\UserName\AppData\Roaming

C:\Users\UserName\AppData\Local\Programs

and I think I deleted some folders also here out of desperation

C:\msys64\mingw64

Now if I try to write pip --version to CMD or python3 -m ensurepip (although I have installed python of version 3.9.7) this error occurs.

C:\WINDOWS\system32>"C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe" -m pip install tkinter -t"C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\site-packages"
C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe: No module named pip

C:\WINDOWS\system32>python3 -m ensurepip
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'C:\\msys64\\mingw64\\bin\\python3.exe'
  sys.base_prefix = 'D:\\a\\msys64\\mingw64'
  sys.base_exec_prefix = 'D:\\a\\msys64\\mingw64'
  sys.platlibdir = 'lib'
  sys.executable = 'C:\\msys64\\mingw64\\bin\\python3.exe'
  sys.prefix = 'D:\\a\\msys64\\mingw64'
  sys.exec_prefix = 'D:\\a\\msys64\\mingw64'
  sys.path = [
    'D:\\a\\msys64\\mingw64\\lib\\python39.zip',
    'D:\\a\\msys64\\mingw64\\lib\\python3.9',
    'D:\\a\\msys64\\mingw64\\lib\\lib-dynload',
    '',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000b4 (most recent call first):
<no Python frame>

Only what is changing is current thread (Current thread 0x00004604, Current thread 0x00001dec,Current thread 0x00004e18)


Solution

  • I have tried to install pip by installing it using blender python like this:

    C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe -m ensurepip
    

    and then upgrade I upgraded it

    C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe -m pip install --upgrade pip