2016-04-28 179 views
0

我是Ubuntu和OpenCV的新手。我正在嘗試使用本教程開始。但是,在步驟7和8中,我無法安裝pip無法安裝pip virtualenv virtualenvwrapper opencv3 python2.7 ubuntu

wget https://bootstrap.pypa.io/get-pip.py 
sudo python get-pip.py 

我該怎麼辦?我得到這個錯誤:

The directory '/home/renzo/.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/renzo/.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.

/tmp/tmpUEma37/pip.zip/pip/vendor/requests/packages/urllib3/util/ssl.py:315: 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. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning .

/tmp/tmpUEma37/pip.zip/pip/vendor/requests/packages/urllib3/util/ssl.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning . Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg

+0

你可能更有可能從[Ask Ubuntu](http://askubuntu.com)社區獲得答案 –

回答

0

首先要做的是獲得該目錄的所有權。在一般情況下,在你的home目錄(/ home /倫佐)中的所有文件應由用戶(在你的情況下,倫佐)所擁有,而是要專門解決你的問題,採取.cache文件夾的所有權:

chown -R renzo /home/renzo/.cache 

您可能需要使用sudo前綴它,即:

sudo chown -R renzo /home/renzo/.cache 

的-R使得它遞歸,倫佐是您的用戶名,並隱藏dotfile(實際上文件夾)是.cache

一旦你這樣做那,再次嘗試安裝命令。