Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.6K
Views
Error grave de Python: init_fs_encoding: no se pudo obtener el códec de Python de la codificación del sistema de archivos al intentar iniciar uwsgi

Estoy tratando de iniciar mi servidor uwsgi en mi entorno virtual, pero después de agregar la opción plugin python3 , aparece este error cada vez:

 !!! Python Home is not a directory: /home/env3/educ !!! Set PythonHome to /home/env3/educ Python path configuration: PYTHONHOME = '/home/env3/educ' PYTHONPATH = (not set) program name = '/home/env3/educ/bin/python' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = '/home/env3/educ/bin/python' sys.base_prefix = '/home/env3/educ' sys.base_exec_prefix = '/home/env3/educ' sys.executable = '/home/env3/educ/bin/python' sys.prefix = '/home/env3/educ' sys.exec_prefix = '/home/env3/educ' sys.path = [ '/home/env3/educ/lib/python38.zip', '/home/env3/educ/lib/python3.8', '/home/env3/educ/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 0x00007efe89db8780 (most recent call first): <no Python frame>

También traté de crear un nuevo entorno virtual usando python3 -m venv env y le moví los archivos del proyecto, pero sigo teniendo el mismo error. Aquí está mi archivo uwsgi.ini:

 [uwsgi] base = /home/env3/educ projectname = educ plugins = python3 master = true virtualenv = /home/env3/%(projectname) pythonpath = %(base) env = DJANGO_SETTINGS_MODULE=%(projectname).settings.pro module = %(projectname).wsgi:application socket = /tmp/%(projectname).sock chmod-socket = 666

Yo uso Phyton 3.8.5

Estoy tratando de usar Django + uWSGI + nginx + Postgresql

si necesitas mas detalles te los doy

Gracias

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Encontré una solución mientras navegaba por Bing, no por Google.

Veo que su PYTHONHOME está configurado en PYTHONHOME = '/home/env3/educ' . Intenta comprobar si realmente está allí.

La solución para mí fue eliminar la variable de entorno PYTHONHOME . Para usted, puede ser solo eso, o establecer esa variable en otro valor. Esto funcionó en Windows y funcionaría en Linux con seguridad. Si alguien intenta esto, ¡por favor publique un comentario aquí!

Un desarrollador de CPython confirmó la solución aquí. :

Este no es un error de Python, es un síntoma de configurar PYTHONHOME y/o PYTHONPATH cuando no son necesarios. En casi todos los casos, no es necesario configurar ninguno de ellos ;

En el caso de PYTHONHOME , casi siempre es un error establecer .

over 4 years ago · Santiago Trujillo Report

0

Resuelvo este problema desactivando PYTHONHOME o PYTHONPATH, porque anulan las variables del entorno virtual.

En mi caso, esto se debe al entorno base de mi administrador. Intentaría eliminar las variables PYTHONHOME y PYTHONPATH haciendo

 unset PYTHONPATH unset PYTHONHOME
over 4 years ago · Santiago Trujillo Report

0

Este mensaje es para aquellos con el mismo problema que encontrarán esta página más adelante. No pude iniciar uWSGI con mi configuración y recibí el mismo mensaje en los archivos de registro.

init_fs_encoding: no se pudo obtener el códec de Python del sistema de archivos que codifica el estado de tiempo de ejecución de Python: core initialized ModuleNotFoundError: ningún módulo llamado 'codificaciones'

El problema era que uWSGI no tenía suficientes permisos para acceder al entorno virtual. Cuando arreglé los permisos, uWSGI inició mi configuración.

Denys publicó la configuración de uwsgi.ini en su mensaje. Supongo que la ruta al entorno virtual es incorrecta.

 base = /home/env3/educ projectname = educ virtualenv = /home/env3/%(projectname)

Si el entorno virtual se creó en el directorio del proyecto, la ruta debería verse así:

 virtualenv = /home/env3/%(projectname)/env
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!