栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

windows10安装python依赖,报错can‘t create or remove files in install directory

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

windows10安装python依赖,报错can‘t create or remove files in install directory

执行python setup.py安装依赖时,报如下错误:can’t create or remove files in install directory。

>> python setup.py install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-19811.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/2.7/site-packages/
    ......

报错:无法在安装目录中创建或删除文件,想到是没有权限的问题,查问题都说使用管理员权限重新执行上面命令即可。但是使用管理员权限打开terminal,再次执行python setup.py install这个命令,还是报上面的错误。

下面通过卸载Windows自带的Python,然后重装解决这个问题。

在左下角搜索 设置 -> 应用,搜索python,然后点击卸载。

卸载后,到https://www.python.org/downloads/windows/下载对应系统的可执行文件安装器,我的是64位,这里选择安装64位的Windows可执行文件安装器。

选择自定义安装,这里放到d盘softs目录下,选择将python添加到PATH环境变量中。

安装成功后,在terminal中运行python命令,如下对应版本信息,即表明安装成功。

然后,再执行python setup.py install命令,即可下载相关的依赖。

参考

win10安装python详细过程

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/307920.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号