jupyter-xeus / xeus-python-wheel

Building a PyPI wheel for xeus-python
BSD 3-Clause "New" or "Revised" License
12 stars 13 forks source link

Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings #41

Closed jeffery9876 closed 4 years ago

jeffery9876 commented 4 years ago

Hi I've tried re-creating the virtual environment many times using python3 -m venv env/jupyter

but it keep showing this errors. My python (v3.6.5) in the venv runs fine.

xeus-python wheel version: 0.6.13

Collecting xeus-python
  Downloading xeus_python-0.6.13-cp36-cp36m-manylinux2010_x86_64.whl (4.1 MB)
     |████████████████████████████████| 4.1 MB 3.1 MB/s
Requirement already satisfied: pygments in ./env/jupyter2/lib/python3.6/dist-packages (from xeus-python) (2.6.1)
Requirement already satisfied: jedi in ./env/jupyter2/lib/python3.6/dist-packages (from xeus-python) (0.16.0)
Requirement already satisfied: parso>=0.5.2 in ./env/jupyter2/lib/python3.6/dist-packages (from jedi->xeus-python) (0.6.2)
Installing collected packages: xeus-python

Any idea how to fix it? The xpython kernel on jupyter lab died after selected

Error

(jupyter2) [svc@aws01 ~]$ xpython
registering handler for SIGSEGV
PYTHONHOME set to /home/svc/env/jupyter2/bin/../
Python sys.path set to :/home/svc/env/jupyter2/bin/..//lib/python36.zip:/home/svc/env/jupyter2/bin/..//lib/python3.6:/home/svc/env/jupyter2/bin/..//lib/python3.6/lib-dynload:/home/svc/env/jupyter2/bin/..//lib/python3.6/site-packages:/home/svc/env/jupyter2/bin/..//../lb/python36.zip:/home/svc/env/jupyter2/bin/..//../lib/python3.6:/home/svc/env/jupyter2/bin/..//../lib/python3.6/lib-dynload:/home/svc/env/jupyter2/bin/..//../lib/python3.6/site-packages:/home/svc/env/jupyter2/bin/..//lib64/python36.zip:/home/svc/env/jupyter2/bin/..//lib64/python3.6:/home/svc/env/jupyter2/bin/..//lib64/python3.6/lib-dynload:/home/svc/env/jupyter2/bin/..//lib64/python3.6/site-packages:/home/svc/env/jupyter2/bin/..//../lib64/python36.zip:/home/svc/env/jupyter2/bin/..//../lib64/python3.6:/home/svc/env/jupyter2/bin/..//../lib64/python3.6/lib-dynload:/home/svc/env/jupyter2/bin/..//../lib64/python3.6/site-packages:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fbaf97a57c0 (most recent call first):
Aborted
SylvainCorlay commented 4 years ago

Hi @JefferyLondon thanks for reporting this here!

FYI, the PyPI wheels are still experimental, and we recommend using a package manager, such as conda. We maintain conda-forge packages for xeus-python.

However, we are working really hard on improving the wheels story. The challenge is that xeus-python embeds Python and linux distributions patch python in all kinds of ways. We have a release coming up in the next few hours that fixes some of the issues, but will not yet enable virtual environments.

jeffery9876 commented 4 years ago

Hi Just confirming the version v0.7.0 still has the same issue.

SylvainCorlay commented 4 years ago

@JefferyLondon this should be fixed in the latest version (v0.7.1).