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

オープン
#325 コメント 6 件 リアクション 10 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python, shell
領域
cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Shell
スター
6.7k
フォーク
433
平均マージ
1日 8時間
マージ済み PR(30日)
11

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pyenv/pyenv-virtualenv のほかの issue

pyenv/pyenv-virtualenv の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。