V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
jakeyfly
V2EX  ›  问与答

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

  •  
  •   jakeyfly · 2018-02-08 00:27:59 +08:00 · 3723 次点击
    这是一个创建于 2499 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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'

    vyronlee
        1
    vyronlee  
       2018-02-08 00:31:58 +08:00 via iPhone
    加 sudo
    litanid
        2
    litanid  
       2018-02-08 01:16:10 +08:00
    也可以试下 python3 -m pip install
    Comphuse
        3
    Comphuse  
       2018-02-08 01:49:54 +08:00   ❤️ 1
    pip3 install --user 包名
    看错误信息最后一行:Permission denied. pip 默认安装系统目录,以普通用户运行是没有权限的。加上 --user 会装到 ~/.local 下面。
    参见: https://pip.pypa.io/en/stable/
    Comphuse
        4
    Comphuse  
       2018-02-08 01:50:32 +08:00
    另外除非你明确知道自己在干什么,不要 sudo pip。
    ruoniao
        5
    ruoniao  
       2018-02-08 08:17:00 +08:00
    好巧,昨天我同事也是,哈哈
    cry0816
        6
    cry0816  
       2018-02-08 09:53:04 +08:00 via Android
    @litanid 抱歉,新手问一下,-m 是什么意思呢?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3897 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 05:30 · PVG 13:30 · LAX 21:30 · JFK 00:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.