2017-03-01 13 views
-1

仮想環境でpipをアップグレードしようとしています。私は、ubuntu 14.04マシンでvenvburritoラッパーを使用しています。私はそれを更新しようとすると、私は次のエラーを取得する:仮想環境でPIPをアップグレードできません

(virtual_env) [email protected]:~$ pip install pip --upgrade 
Collecting pip 
    Using cached pip-9.0.1-py2.py3-none-any.whl 
Installing collected packages: pip 
    Found existing installation: pip 8.1.2 
    Not uninstalling pip at /home/ubuntu/.venvburrito/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg, outside environment /home/ubuntu/.virtualenvs/virtual_env 
Successfully installed pip-8.1.2 
You are using pip version 8.1.2, however version 9.0.1 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 

私は、sudoでそれをしようとすると、仮想環境内で、私は次のエラーを取得する:

(virtual_env) [email protected]:~$ sudo pip install --upgrade pip 
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
/home/ubuntu/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. 
    SNIMissingWarning 
/home/ubuntu/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. 
    InsecurePlatformWarning 
Requirement already up-to-date: pip in ./.local/lib/python2.7/site-packages 
/home/ubuntu/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. 
    InsecurePlatformWarning 

私は外でそれを行うと仮想環境では、正しくインストールされます。

ご協力いただければ幸いです。

おかげ

+1

何をしているのか正確にわからない場合は、 'sudo pip'を使わないでください! 'sudo'は環境変数を保存しないので、venvを"中断 "し、ネイティブにインストールされたパッケージと干渉するシステムのPythonインストールを変更することができます。特にvenvsで作業している場合は、sudoでpipを実行する必要はありません。 – mata

+0

ありがとう@mataは、 – Escachator

+0

@SiddheshMhatre素敵な仕事に注意しますが、あなたはpipが自分自身をインストールすることができないkidoのためにその仕事を説明する必要があります。 –

答えて

1

時々、これは(私はアップグレードすると1番目のコマンドではないピップ、同様の問題は、私のために働いていた)ことができます:仮想環境でpipをアップグレードするには

python -m ensurepip 

または

python -m ensurepip --upgrade 
+0

@Drakoの面白いと聞こえますが、私は '確実な名前のモジュールはありません' ... – Escachator

+1

それはどのバージョンなのか分かりませんが、確かに3.6 – Drako

+0

バージョン3.6に含まれていますか?ありがとう – Escachator

-1

です他のものと同じようにPyPI package;あなた自身にあなたが任意のパッケージをアップグレードするのと同じ方法でアップグレードするためにそれを使用することができます。Windows上で

pip install --upgrade pip 

を、より安全な方法がrun pip though a python moduleにあるある:

python -m pip install --upgrade pip 

OR

python -m pip install -U pip 

Windowsは、自分自身を置き換えようとするバイナリに問題があるようですが、この方法はその制限を回避して動作します。

+2

私はあなたの質問を読んでいるか分からない。これはまったく動作しなかったものです。 – Escachator

+0

それを試してみてください。 'pip install pip --upgrade'を使ってpipをアップグレードすることはできません。これはpython -m pip install -upgrade pipをする必要はありません。 –

+0

@SiddheshMhatre素敵な仕事ですが、ピップが自分自身をインストールすることができないkidoのすべてを説明する必要があります。 –

関連する問題