JuliaPy / JuliaPy/PyCall.jl

Importing local Python module fails in Julia 1.4?

Ouverte
#781 5 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Julia
Étoiles
1.5k
Forks
186
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi, I have the following code
```julia
using PyCall
pushfirst!(PyVector(pyimport("sys")."path"), srcdir())
pypsd = pyimport("PSD")
```
`srcdir()` is a *directory* that points to a *folder* which includes a *file* `PSD.jl`.I was using this code about 3 months ago and it worked fine for me.

Unfortunately it doesn't work anymore, even though there was absolutely nothing changed in my source code:
```
ERROR: LoadError: PyCall.PyError("PyImport_ImportModule\n\nThe Python package PSD could not be found by pyimport. Usually this means\nthat you did not install PSD in the Python version being u...
```

The only difference with the past I can think of is that I'm now using a more recent Julia version, 1.4. Has the way of including local modules changed? I've looked at the readme, but I only found a note that PyCall.jl doesn't include current directory by default, but this is not my case.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Reproduisez l’échec avec la séquence indiquée de `PyCall`, `pyimport("sys")`, `sys.path`, `srcdir()` et `PSD` sous Julia 1.4. Commencez par vérifier comment le répertoire local et le module `PSD` sont exposés à Python, puis comparez le comportement avec la configuration qui fonctionnait auparavant. Le travail est terminé lorsque le module local `PSD` s’importe correctement ou que le problème est clarifié avec la configuration requise.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
backend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.