【问题标题】:Python local install python package fails because "account does not have write access"Python本地安装python包失败,因为“帐户没有写权限”
【发布时间】:2022-01-02 20:42:25
【问题描述】:

我在基于 unix 的机器上使用 python 已经有一段时间了,但我现在正在尝试使用 windows 机器在本地安装我制作的一些包。

我通常在 unix 中使用 setup.py 导航到文件夹并在终端中运行以下命令

python -m pip install -e .

在我的 windows 机器上,我安装了Windows Terminal,它使用了 powershell。尝试与我得到的相同的东西:

C:\Users\username\AppData\Local\Temp\pip-build-env-bohtedqu\overlay\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    error: cant create or remove files in install directory

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

我已经查找了如何解决此问题,但没有任何效果。我试过以管理员身份启动 Windows 终端,得到同样的结果。我还尝试下载gsudo 并将 sudo 添加到命令的开头,没有任何变化。我真的不太熟悉 windows 上的 python,所以我可能会做一些非常愚蠢的事情,任何建议都值得赞赏。

【问题讨论】:

    标签: python python-3.x windows powershell windows-terminal


    【解决方案1】:

    以管理员身份运行 cmd 并将超级管理员激活为 'net user administrator /active:yes'。以超级管理员身份重启系统。希望能解决问题。

    【讨论】:

    • 不,不幸的是会导致同样的错误。太疯狂了,“超级管理员”权限不够。
    • 那么您需要做的就是导航到该文件夹​​并使用 cmd 运行“python setup.py install”
    • 确保您已安装最新版本的 pip。
    • 不幸的是,仍然报同样的错误。
    • 可以分享代码沙箱链接
    猜你喜欢
    • 1970-01-01
    • 2019-11-22
    • 2018-11-11
    • 2019-11-19
    • 1970-01-01
    • 1970-01-01
    • 2014-01-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多