Pyenv virtualenv does not shim pip - uses shimmed python, system pip

Aperta
#325 6 commenti 10 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python, shell
Ambito
cli

Direzione di ricerca

Reproduce the sequence using pyenv install, pyenv virtualenv, pyenv activate, which python, which pip, and pyenv rehash. Trace why Python resolves through /Users/bar/.pyenv/shims/python while pip resolves to /usr/local/bin/pip; done means pip targets the activated virtualenv and installed packages are available to its Python.

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

Descrizione

I have been using (Homebrew) pyenv and pyenv-virtualenv for a long time, and my usual procedure for creating a virtual environment (with 3.7.4, for example) is:

pyenv install 3.7.4
pyenv virtualenv 3.7.4 foo
pyenv activate foo

This works fine, and running which python gives:
/Users/bar/.pyenv/shims/python
And python --version gives:
Python 3.7.4
as expected.

However, doing the same for pip gives:
/usr/local/bin/pip
i.e., the system pip. This also means that pip installing anything installs it to the system python, not to the virtualenv (packages are not subsequently available in the virtualenv, e.g. pip install django, followed by running a python django app, complains that there is no django installed)

This suggests that there is no shim for pip, which is weird, because this has always worked for me in the past. I have tried uninstalling both pyenv and pyenv-virtualenv, deleting .pyenv, and reinstalling them, but it made no difference.

I have tried running pyenv rehash

Lingua principale
Shell
Stelle
6.7k
Fork
433
Merge medio
1g 8h
PR unite (30g)
11

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pyenv/pyenv-virtualenv

Tutte le issue di pyenv/pyenv-virtualenv

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.