Issue with installing packages for Python - 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

Related

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.

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding ModuleNotFoundError: No module named 'encodings'

I'm quite new to programming. For the last couple of months I was working with PyCharm without any issues and also didn't do any changes (not sure if I have by accident deleted anything in Pycharm in the external libraries which may be causing any issues?).
When running python.exe via CMD I get below error. Same appears in PyCharm, only that the PYTHONPATH differs
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
sys.base_prefix = ''
sys.base_exec_prefix = ''
sys.platlibdir = 'lib'
sys.executable = 'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
sys.prefix = ''
sys.exec_prefix = ''
sys.path = [
'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip',
'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\',
'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\DLLs\\',
'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310',
]
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 0x00002e60 (most recent call first):
<no Python frame>
What can I do here?
Thanks for any kind of help :-)
Update: What finally solved my problem was to simply deinstall and reinstall Python. Still no clue what even caused the issue in the first place but it is gone
I encountered the same problem. Reinstalling python solved mine

cygwin python installation: "Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding"

I'm trying to set up a new cygwin installation and install python through cygwin. I've done so, and the setup completed, but when I try to run python3.8 I get a fatal python error:
$ python3.8
Python path configuration:
PYTHONHOME = 'C:\Users\cmhac\AppData\Local\Programs\Python\Python38'
PYTHONPATH = 'C:\Users\cmhac\AppData\Local\Programs\Python\Python38'
program name = 'python3.8'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3.8.exe'
sys.base_prefix = 'C'
sys.base_exec_prefix = '\\Users\\cmhac\\AppData\\Local\\Programs\\Python\\Python38'
sys.executable = '/usr/bin/python3.8.exe'
sys.prefix = 'C'
sys.exec_prefix = '\\Users\\cmhac\\AppData\\Local\\Programs\\Python\\Python38'
sys.path = [
'C',
'\\Users\\cmhac\\AppData\\Local\\Programs\\Python\\Python38',
'C/lib/python38.zip',
'C/lib/python3.8',
'\\Users\\cmhac\\AppData\\Local\\Programs\\Python\\Python38/lib/python3.8/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 0x0000000800000010 (most recent call first):
<no Python frame>
How do I even begin fixing this? The python38.exe file is there, and everything seems fine. Never had this error with any other python installation.
I saw this exact error:
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'
If you set these two env variables to nil, the problem should disappear:
set PYTHONHOME=
set PYTHONPATH=
Go to your wsgi.py file under your project and do something similar to:
import os
import sys
from django.core.wsgi import get_wsgi_application
sys.path.append('path/to/yourprojectenv/lib/python3.8/site-packages')
Restart your server and try again.

Categories

Resources