【问题标题】:Messed up Python packages installement? (OS X)搞砸了 Python 软件包安装? (OS X)
【发布时间】:2018-02-18 16:30:51
【问题描述】:

我想我以某种方式搞砸了为 python 和整个环境安装包。每当我想安装某些东西时,都会遇到以下问题:

directory is not owned by the current user and the cache has been disabled

PyCharm 还认为我仍然需要安装引用的包(没有模块。这是错误的,因为我可以使用它们。当我点击“安装引用的包”时,我会收到上面提到的警告加上:

OSError: [Errno 1] Operation not permitted

希望你们中的一个可以提供帮助! :(

最好的问候 马蒂亚斯

编辑:在某些时候,我还为 python 安装了一个 venv。也许这与我的问题有关。很抱歉,我是新手,不知道自己在做什么。

【问题讨论】:

    标签: python installation dependencies pip


    【解决方案1】:

    如果你运行,你的权限有问题

    which python
    

    您将看到当前版本的 python 的安装位置。如果您使用的是 osx,我强烈建议您在此处下载 brew:https://brew.sh/。只需将该命令粘贴到您的终端,然后您应该通过运行安装 python:

    brew install python
    

    这将为您提供稍后的说明,但 brew 捆绑版本的 python 比与您的系统捆绑的版本更强大。另一个注意事项是,如果您使用虚拟环境,请考虑使用 virtualenvwrapper here。这应该会让你的事情运行得更顺利:)

    希望对您有所帮助。

    【讨论】:

    • 另外,它可能就像运行 chown 并将 python 发行版的所有权设置为您自己的用户名一样简单。但同样,为了避免此类问题,我会使用 brew 为我管理这些事情。
    • 当我输入返回哪个 python 时
      /usr/bin/python 当我想与我的用户一起将 chown 添加到该路径时,我得到:
      chown: /usr/bin/python: Operation not permitted
    • sudo chown !! 你必须 sudo 因为它目前不属于你的用户。
    • 我是用 sudo 做的:/ 我的活跃用户是 kajuken (id -un) sudo chown kajuken /usr/bin/python chown: /usr/bin/python: Operation not allowed
    • 是的,在这种情况下,我会非常认真地推荐使用 brew 来运行 python。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-23
    相关资源
    最近更新 更多