在python3中安装或更新软件包时,EnvironmentError [Errno 39]“目录不为空”

问题描述 投票:0回答:1

在这里发布了问答,因为还没有关于此类错误的SO帖子,而网络搜索的其他链接导致了未解决的gihub问题。这是我在虚拟python环境中更新包:

(py36) $ pip install tornado -U
Collecting tornado
  Downloading https://files.pythonhosted.org/packages/03/3f/5f89d99fca3c0100c8cede4f53f660b126d39e0d6a1e943e95cc3ed386fb/tornado-6.0.2.tar.gz (481kB)
    100% |████████████████████████████████| 491kB 476kB/s 
Building wheels for collected packages: tornado
  Building wheel for tornado (setup.py) ... done
  Stored in directory: /home/nikhil/.cache/pip/wheels/61/7e/7a/5e02e60dc329aef32ecf70e0425319ee7e2198c3a7cf98b4a2
Successfully built tornado
Installing collected packages: tornado
  Found existing installation: tornado 5.1.1
    Uninstalling tornado-5.1.1:
      Successfully uninstalled tornado-5.1.1
Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '/mnt/STUFF/py36/lib/python3.6/site-packages/~ornado'

那么如何解决这个问题呢?

python pip
1个回答
0
投票

检查错误消息中突出显示的实际文件夹:

/mnt/STUFF/py36/lib/python3.6/site-packages/~ornado

我发现那里有另外一个.fuse-hidden...文件,这些文件通常在我的文件夹中运行时使用Geany(文本编辑器),然后在我保存文件后刷新我的文件夹后消失。不知何故,这样的文件也在这里创建,永远不会删除。请注意,这可能是我操作系统的错,而不是Geany的 - IDK。无论如何我自己删除了文件并运行了升级命令,这次没有错误。

© www.soinside.com 2019 - 2024. All rights reserved.