如何修正pip的路径(python2.7)
how to correct the path of pip (python2.7)
我的系统是ubuntu16.04
我有 python2.7 和 python3.5
在我使用 alias python=python3
&& unalias python
之后
python2.7 和 python3.5 混淆
然后我发现我有两个pip2.7的路径
$ which -a pip
/usr/local/bin/pip
/home/user/.local/bin/
然后我删除 python-pip
$ sudo apt-get autoremove python-pip
并重新安装 pip
python get-pip.py --prefix=/usr/local/
$ which -a pip
/usr/local/bin/pip
当我尝试安装包时,结果是
$ sudo pip install numpy
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
The directory '/home/user/.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/user/.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: numpy in /home/user/.local/lib/python2.7/site-packages (1.15.2)
我该如何解决?任何的想法?非常感谢
- /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/init.py:83: RequestsDependencyWarning: 旧版本的密码学 ([1, 2, 3])可能会导致减速。
warnings.warn(警告,RequestsDependencyWarning)
- 要求已经满足:numpy in /home/user/.local/lib/python2.7/site-packages (1.15.2)
当您 运行 sudo
那样时,它的家仍然是您的(非 root)家。所以它创建的任何目录,比如直接缓存,都将归根所有。您只需:
sudo rm -rf /home/user/.cache/pip/http
删除缓存目录。 运行 再次作为非 root 用户,您将不会看到错误。
我的系统是ubuntu16.04 我有 python2.7 和 python3.5
在我使用 alias python=python3
&& unalias python
python2.7 和 python3.5 混淆
然后我发现我有两个pip2.7的路径
$ which -a pip
/usr/local/bin/pip
/home/user/.local/bin/
然后我删除 python-pip
$ sudo apt-get autoremove python-pip
并重新安装 pip
python get-pip.py --prefix=/usr/local/
$ which -a pip
/usr/local/bin/pip
当我尝试安装包时,结果是
$ sudo pip install numpy
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
The directory '/home/user/.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/user/.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: numpy in /home/user/.local/lib/python2.7/site-packages (1.15.2)
我该如何解决?任何的想法?非常感谢
- /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/init.py:83: RequestsDependencyWarning: 旧版本的密码学 ([1, 2, 3])可能会导致减速。 warnings.warn(警告,RequestsDependencyWarning)
- 要求已经满足:numpy in /home/user/.local/lib/python2.7/site-packages (1.15.2)
当您 运行 sudo
那样时,它的家仍然是您的(非 root)家。所以它创建的任何目录,比如直接缓存,都将归根所有。您只需:
sudo rm -rf /home/user/.cache/pip/http
删除缓存目录。 运行 再次作为非 root 用户,您将不会看到错误。