Python安装工具包时的问题与解决

在安装pandas包时因网络连接中断导致下载不完全,重新下载时

$ pip install pandas

出现:

Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决方法:
$ pip install --user pandas

--user 使该包只安装在当前用户的目录下

此外:

如果使用sudo(为所有用户安装该包):

$ sudo pip install pandas

系统会提示:

The directory '/Users/rhea/Library/Caches/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.

同样,安装会失败:

Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

事实上,StackOverflow上的说法是:
'Never never ever use sudo pip install; you could overwrite important stuff without knowing it. Use pip install --user instead!'

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 12,251评论 3 20
  • 我想告诉你,爱我你不需要担心任何事情,因为我可以解决任何问题。你说我太傻意识不到问题那是因为你担心的那些在我心里都...
    罚抄李雯一万遍阅读 198评论 11 1
  • 寻找属于自己的那条玉镯 腾冲素有“翡翠之乡”,“玉石城”之称,加之经营玉雕已有500余年历史,是西南最大的玉石翡翠...
    任亚阅读 202评论 0 0
  • 今天好忙又变天感觉有点感冒,晚上辅导儿子做作业时看到凌乱的桌面,忍不住对他说:“你不是很喜欢妈妈为你收拾...
    轩莉多彩阅读 167评论 0 0
  • 最近很喜欢一句话,特别简单的一句话:“以你的努力程度,你的人生最坏的结果,也不过是大器晚成。”不知道为什么,一想到...
    婉琰阅读 403评论 0 0