python3.5 安装 xlrd xlwt 包都不成功 求解决 报错如下

2018-02-08 00:27:59 +08:00
 jakeyfly

liusanye@DESKTOP-O9QRQ7C:~$ pip3 install xlwt Collecting xlwt Downloading xlwt-1.3.0-py2.py3-none-any.whl (99kB) 100% |████████████████████████████████| 102kB 22kB/s Installing collected packages: xlwt Exception: Traceback (most recent call last): File "/home/liusanye/.local/lib/python3.5/site-packages/pip/basecommand.py", l ine 215, in main status = self.run(options, args) File "/home/liusanye/.local/lib/python3.5/site-packages/pip/commands/install.p y", line 342, in run prefix=options.prefix_path, File "/home/liusanye/.local/lib/python3.5/site-packages/pip/req/req_set.py", l ine 784, in install **kwargs File "/home/liusanye/.local/lib/python3.5/site-packages/pip/req/req_install.py ", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/home/liusanye/.local/lib/python3.5/site-packages/pip/req/req_install.py ", line 1064, in move_wheel_files isolated=self.isolated, File "/home/liusanye/.local/lib/python3.5/site-packages/pip/wheel.py", line 34 5, in move_wheel_files clobber(source, lib_dir, True) File "/home/liusanye/.local/lib/python3.5/site-packages/pip/wheel.py", line 31 6, in clobber ensure_dir(destdir) File "/home/liusanye/.local/lib/python3.5/site-packages/pip/utils/init.py" , line 83, in ensure_dir os.makedirs(path) File "/usr/lib/python3.5/os.py", line 241, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-pa ckages/xlwt'

3729 次点击
所在节点    问与答
6 条回复
vyronlee
2018-02-08 00:31:58 +08:00
加 sudo
litanid
2018-02-08 01:16:10 +08:00
也可以试下 python3 -m pip install
Comphuse
2018-02-08 01:49:54 +08:00
pip3 install --user 包名
看错误信息最后一行:Permission denied. pip 默认安装系统目录,以普通用户运行是没有权限的。加上 --user 会装到 ~/.local 下面。
参见: https://pip.pypa.io/en/stable/
Comphuse
2018-02-08 01:50:32 +08:00
另外除非你明确知道自己在干什么,不要 sudo pip。
ruoniao
2018-02-08 08:17:00 +08:00
好巧,昨天我同事也是,哈哈
cry0816
2018-02-08 09:53:04 +08:00
@litanid 抱歉,新手问一下,-m 是什么意思呢?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/429332

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX