2017-05-15 9 views
0

私のUbuntu 16.04デスクトップには、python2.7.12とpython3.6.1がインストールされています。Python3 pip3はリクエストをインストールできない

[email protected]:~$ python --version 
Python 2.7.12 
[email protected]:~$ python3 --version 
Python 3.6.1 

また、pipとpip3もインストールしました。 pipがpython2用でpip3がpython3用であるのは本当ですか?

[email protected]:~$ pip --version 
pip 9.0.1 from /home/seept/.local/lib/python3.5/site-packages (python 3.5) 
[email protected]:~$ pip3 --version 
pip 9.0.1 from /home/seept/.local/lib/python3.5/site-packages (python 3.5) 

なぜPythonの3.5:

は、なぜ地獄ピップの両方のバージョンは私にこのことを示して?

[email protected]:~$ which python 
/usr/bin/python 

[email protected]:~$ which python3 
/usr/local/bin/python3 

[email protected]:~$ which pip 
/home/seept/.local/bin/pip 

[email protected]:~$ which pip3 
/home/seept/.local/bin/pip3 

私の本当の問題は、python3プロジェクトのモジュール '要求'が必要なことです。

私は実行すると:

[email protected]:~$ sudo pip3 install requests 

は、これが出力されます:私は、常にこのメッセージが表示されますところで

The directory '/home/seept/.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/seept/.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. 
**Requirement already satisfied: requests in ./.local/lib/python3.5/site-packages** 

You are using pip version 8.1.1, however version 9.0.1 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 

したがって、この出力は、私が使用していますと言いますpip verison 8.1.1ですが、pip --versionを実行すると私にはバージョン9.0.1が実行されています。

私の場合、私はすでにそれを台無しにして、すべてを再インストールする必要がありますか?

+0

あなたの 'pip'は'/home/seept/.local/bin/pip'にありますので、おそらくPython 3.5のインストールやvirtualenvもあります。代わりに 'python3 -m pip'を使用してください。 –

答えて

0

virtualenvでプロジェクトを実行する必要があります。あなたのプロジェクトディレクトリを安全に保ち、他のバージョンとの衝突を避けます。プロジェクトディレクトリに

移動し、ちょうど使用して最初のvirtualenvのインストール:あなたのパッケージがvirtualenvのをアクティブにするために、これを実行してインストールする前に

pip install virtualenv 

を:

source venv/bin/activate 

今、あなたのディレクトリは安全であり、あなたがあなたをインストールすることができます他のディレクトリから安全かつユニークなままにするためにここにパッケージしてください。

あなたは私のコンセプトを理解してくれることを願っています。

ありがとうございました。

+0

ありがとう、ありがとう。 – LuluLolala

関連する問題