JuliaPy / JuliaPy/PyCall.jl

Feature Request because of the issue(difficult to add a custom Python version, and packages)

Aperta
#947 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
1.5k
Fork
186
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hey there currently i´m building a docker julia template i want to share with everyone.
https://github.com/MalteBoehm/julia_docker-compose_template

The current issue is that when i install my own python environment, PyCall adds a HOMEPYTHON Env variable which causes a Fatal Python error and its not possible to unset those variables.

See here:
https://github.com/MalteBoehm/julia_docker-compose_template/blob/main/Dockerfile

My suggestion is to add parameters to PyCall from the very beginning, like Python Version and if should install packages via

environment.yml ->
`conda env create environment.yml
conda activate yourEnviroment`

This is the Error i get:
`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 0x00007f43d5ea5b48 (most recent call first):
Current thread 0x00007f84a9e9bb48 (most recent call first):

Python path configuration:

PYTHONHOME = '/root/.pyenv/versions/3.7.8:/root/.pyenv/versions/3.7.8'

PYTHONPATH = (not set)

program name = '/root/.pyenv/versions/3.7.8/bin/python3'

isolated = 0

environment = 1

user site = 1

import site = 1

sys._base_executable = '/root/.pyenv/versions/3.7.8/bin/python3'

sys.base_prefix = '/root/.pyenv/versions/3.7.8'

sys.base_exec_prefix = '/root/.pyenv/versions/3.7.8'

sys.platlibdir = 'lib'

sys.executable = '/root/.pyenv/versions/3.7.8/bin/python3'

sys.prefix = '/root/.pyenv/versions/3.7.8'

sys.exec_prefix = '/root/.pyenv/versions/3.7.8'

sys.path = [

'/root/.pyenv/versions/3.7.8/lib/python39.zip',

'/root/.pyenv/versions/3.7.8/lib/python3.9',

'/root/.pyenv/versions/3.7.8/lib/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'`

Thanks for your help

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the failure using the linked Dockerfile and the PyCall setup described in the issue, then inspect PyCall’s existing Python configuration entry points. The issue names no repository files or tests; done would mean a documented way to select a Python version and install packages from environment.yml without the reported fatal initialization error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, julia, python
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.