Python is in path but can't open it in terminal - python

I tried to install the latest python version, it concluded and the path is correct in the user variables, however I can't open it in the terminal.
When I try to open I get this message:
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 = 'C:\Program Files\Inkscape\bin\python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Program Files\\Inkscape\\bin\\python.exe'
sys.base_prefix = 'D:\\a\\msys64\\mingw64'
sys.base_exec_prefix = 'D:\\a\\msys64\\mingw64'
sys.platlibdir = 'lib'
sys.executable = 'C:\\Program Files\\Inkscape\\bin\\python.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 0x000027c8 (most recent call first):
<no Python frame>
I also have no idea why there is a python.exe in an Inkscape folder. The previous version of python was installed there, which I also have no idea why.

Related

Python path configuration errors

So, long story short, as a young naive programmer I installed Python on the same machine too many times, to the point that it took me hours to simply do use libraries simply because they were "not found".
I decided to change that today and tried to delete all Python configurations and to a clean install of Python 3.11 on C:\Program Files\ (keep in mind I had multiple installs of Python in multiple folders) and now when trying to run python3 filename.py I get this daunting error:
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 = 'C:\msys64\mingw64\bin\python3.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\msys64\\mingw64\\bin\\python3.exe'
sys.base_prefix = 'D:\\a\\_temp\\msys\\msys64\\mingw64'
sys.base_exec_prefix = 'D:\\a\\_temp\\msys\\msys64\\mingw64'
sys.platlibdir = 'lib'
sys.executable = 'C:\\msys64\\mingw64\\bin\\python3.exe'
sys.prefix = 'D:\\a\\_temp\\msys\\msys64\\mingw64'
sys.exec_prefix = 'D:\\a\\_temp\\msys\\msys64\\mingw64'
sys.path = [
'D:\\a\\_temp\\msys\\msys64\\mingw64\\lib\\python39.zip',
'D:\\a\\_temp\\msys\\msys64\\mingw64\\lib\\python3.9',
'D:\\a\\_temp\\msys\\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 0x000094d8 (most recent call first):
<no Python frame>
The problem is that I have already deleted the "program name" python3.exe. I have also checked my path and I only have C:\Program Files\Python311\Scripts\ and C:\Program Files\Python311\ in regards to Python-related environment variables.
Is there a way to change the program name variable to my current directory? I believe that will solve my problems. All the best.

Conda not working (ModuleNotFoundError: No module named 'encodings')

I recently tried adding an Xlwings add-in to my ms excel and in doing so, moved around and deleted a bunch of files in my computer. Now I can't run Conda and I get the error message below on my terminal when I try to run any kind of Conda command.
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 = '/opt/anaconda3/bin/python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/opt/anaconda3/bin/python'
sys.base_prefix = '/opt/anaconda3'
sys.base_exec_prefix = '/opt/anaconda3'
sys.platlibdir = 'lib'
sys.executable = '/opt/anaconda3/bin/python'
sys.prefix = '/opt/anaconda3'
sys.exec_prefix = '/opt/anaconda3'
sys.path = [
'/opt/anaconda3/lib/python39.zip',
'/opt/anaconda3/lib/python3.9',
'/opt/anaconda3/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'
I saw the other post ImportError: No module named 'encodings' about this issue and tried following the instructions there but it didn't help in my case. Can someone please help with this? I've been trying to unsuccessfully solve this issue for days now and I'm all out of ideas.
Solved. The solution was to install anaconda3 using command line installer rather than graphical installer.
I had the problem with anaconda under Windows when I have an embedded python in my c++ app via Python C-API.
I had the following error, where they key was, that
c:\ProgramData\Anaconda3\python39.zip
did not exist. I created a text file of that name and that solved for me the problem.
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
[...]
sys.prefix = 'c:\\ProgramData\\Anaconda3'
sys.exec_prefix = 'c:\\ProgramData\\Anaconda3'
sys.path = [
'c:\\ProgramData\\Anaconda3\\python39.zip',
'.\\DLLs',
'.\\lib',
[...],
]
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'

ModuleNotFoundError: No module named 'jtop' | after changing default python setting jetson TX2

I am relatively new to working with Jetson, was following a guide to make python3.8 run as default on my JetsonTX2 which has python3.6 as default, I do not know what I did, but after uninstalling python3.8 and reverting back to python3.6 I got this message:
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 = '/usr/local/bin/python3'
sys.base_prefix = '/usr/local'
sys.base_exec_prefix = '/usr/local'
sys.executable = '/usr/local/bin/python3'
sys.prefix = '/usr/local'
sys.exec_prefix = '/usr/local'
sys.path = [
'/usr/local/lib/python38.zip',
'/usr/local/lib/python3.8',
'/usr/local/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 0x0000007f9d56eaf0 (most recent call first):
<no Python frame>
Afterwhich I typed python3.6, which would normally bring my to python3.6.9, yet got the same error message, then, when trying to reopen my jtop, this error message shows up:
Traceback (most recent call last):
File "/usr/local/bin/jtop", line 7, in <module>
from jtop.__main__ import main
ModuleNotFoundError: No module named 'jtop'
please help, I don't know what to do

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFound

No matter what I do I can't fix the problem. I'm having trouble deploying. I am getting error 503 Service Unavailable.
Current thread 0x00007f6008afd740 (most recent call first):
<no Python frame>
Python path configuration:
PYTHONHOME = '/home/usr/virtualenv/core/3.8'
PYTHONPATH = '.:/home/usr/core/'
program name = '/home/usr/virtualenv/core/3.9/bin/python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/home/usr/virtualenv/core/3.9/bin/python'
sys.base_prefix = '/home/usr/virtualenv/core/3.8'
sys.base_exec_prefix = '/home/usr/virtualenv/core/3.8'
sys.platlibdir = 'lib64'
sys.executable = '/home/usr/virtualenv/core/3.9/bin/python'
sys.prefix = '/home/usr/virtualenv/core/3.8'
sys.exec_prefix = '/home/usr/virtualenv/core/3.8'
sys.path = [
'.',
'/home/usr/core/',
'/home/usr/virtualenv/core/3.8/lib64/python39.zip',
'/home/usr/virtualenv/core/3.8/lib64/python3.9',
'/home/usr/virtualenv/core/3.8/lib64/python3.9/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 0x00007fdbc7fe0740 (most recent call first):
<no Python frame>
I tried almost all the methods I came across with the Google search engine, i tried removing the PYTHONHOME environment variable, which is the most popular solution. I also tried with Linux and Windows. But I never understood the problem. I would be very happy if someone could help me with this.

Issue with installing packages for Python

I'm having an issue with installing Python packages, I've never had this problem before:
error code:
C:\Users\joe_h\.conda>pip install pandas-datareader
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'c:\users\joe_h\anaconda3\anaconda3\python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'c:\\users\\joe_h\\anaconda3\\anaconda3\\python.exe'
sys.base_prefix = ''
sys.base_exec_prefix = ''
sys.executable = 'c:\\users\\joe_h\\anaconda3\\anaconda3\\python.exe'
sys.prefix = ''
sys.exec_prefix = ''
sys.path = [
'c:\\users\\joe_h\\anaconda3\\anaconda3\\python38.zip',
'.\\DLLs',
'.\\lib',
'c:\\users\\joe_h\\anaconda3\\anaconda3',
]
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 0x000028f4 (most recent call first):
<no Python frame>
anyone got any idea what I need to do to start installing packages again? Thanks in advance

Categories

Resources