Reputation: 111
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)
Upvotes: 2
Views: 270
Reputation: 111
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
Upvotes: 0
Reputation: 652
I seem to have had a similar problem, it seems to be a problem of mixing up multiple different Python interpreters. Blender has an embedded Python interpreter, this can be seen in your error message
C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin\python.exe: No module named pip
, this is blender python not having pip, C:\WINDOWS\system32>python3 -m ensurepip
is then ran but it's not the same python, here's the python version you installed.
Following this guide has worked for me, the main idea is to
cd C:\Program Files\Blender Foundation\Blender 3.0\3.0\python
As you already attempted you need to run the module ensure pip (but with python blender). So:
.\bin\python.exe - m ensurepip
You can now run
.\Scripts\pip3.exe install PySimpleGUI
or whatever module and it should be accessible from within blender.
for more information (although I'm not sure how still relevant it is) https://blender.stackexchange.com/questions/5287/using-3rd-party-python-modules
Upvotes: 1