atom-community / atom-community/ide-python

python executable not detected outside of pipenv project

Ouverte
#218 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
238
Forks
40
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

My system python is installed via homebrew/miniconda:
```
$ which python
/usr/local/Caskroom/miniconda/base/bin/python
```
When the python executable setting is left as default `python` PyLS spins up from the base environment fine.

If I set up a project with pipenv and use the suggested `$PIPENV_PATH/bin/python` then it spins up PyLS in the virtual environment and works fine for that project. However, outside of the project the python executable cannot be found.

From reviewing the code it looks like outside of a pipenv project the python path becomes `/bin/python` which is not where my system python lives. It needs to fallback to just `python`.

----
I can see that `$PIPENV_PATH` gets replaced with the output of `pipenv --venv`, however you could use `pipenv --py` to get the full path to the interpreter (or just append `/bin/python` as it's always that). In that case the executable setting won't be needed for pipenv, so it can just remain as the default `python` or be set as an absolute path if needed.

----
N.B As a workaround I tried to symlink `/bin/python` to my miniconda python. However on MacOS SIP prevents this. I'd rather not have to disable it.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

L’issue concerne le paramétrage de l’exécutable et l’intégration avec Pipenv ; commencez par retracer la manière dont `$PIPENV_PATH` est développé lorsqu’aucun projet Pipenv n’est présent. Comparez le comportement signalé de `pipenv --venv` avec `pipenv --py`, puis vérifiez que le `python` par défaut fonctionne à la fois dans et en dehors d’un projet Pipenv.

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

Évaluation

Stack technique
javascript, python
Domaine
devtools
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.