解決pip3命令把安裝包安裝到home下的.local/lib/python3.5/dist-packages目錄下的問題

今天使用pip3安裝numpy時居然給我安裝到了home下的.local/lib/python3.5/dist-packages目錄,有點惱火,按到這裏也是能使用的,但不方便管理呀,不明所以,這pip3咋不安裝到/usr/local/lib/python3.5/dist-packages啦?

懷疑是pip3命令問題,使用find / -name pip3我找到了pip3命令啓動位置,查看了一下,pip3命令中調用了pip命令,而home下的。cache目錄下居然有pip文件夾,進過實驗確實是這樣的,不過還不明白這到底是怎麼回事

百思不得其解,在網上也找了好久沒看到,最後試了下安裝命令前加個sudo居然解決了這個問題。

而且在加上sudo 後出現下面一些警示語句:

sudo pip3 install numpy
The directory '/home/ddyy/.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/ddyy/.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.

不明白這些是說啥,但問題確實解決了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章