JuliaPy / JuliaPy/PyCall.jl

detect ModuleNotFoundError in pyimport

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

Descrizione

Currently, we print `The Python package foo could not be found by pyimport` when [*any* ImportError](https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall.jl#L490) is thrown by `pyimport`. We should only print this on a `ModuleNotFoundError`, as otherwise it is misleading.

Note that we can only do this in Python ≥ 3.6 (https://github.com/python/cpython/commit/c943265ba56e7ce7e2fe79fdecfc6670e10e5467). I guess in earlier versions we could check for `"No module named"` in the `ImportError` string?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.