ModuleNotFoundError:没有名为“gi”的模块

ModuleNotFoundError:没有名为“gi”的模块

尝试启动 Dropbox 时,它会提示

$ dropbox start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon

按照说明,

$ dropbox start -i
Starting Dropbox...Traceback (most recent call last):
  File "/usr/bin/dropbox", line 1443, in start
    download()
  File "/usr/bin/dropbox", line 294, in download
    import gi
ModuleNotFoundError: No module named 'gi'

然后尝试安装 gi

$ pip install gi
Collecting gi
  Could not find a version that satisfies the requirement gi (from versions: )
No matching distribution found for gi

版本:

$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.04
Release:        19.04
Codename:       disco

答案1

确保您没有启用 conda 环境(包括根环境),然后以“sudo dropbox start -i”的形式运行它

答案2

您可以跳过 GTK 界面,这样可以避免加载此gi模块。运行 dropbox 脚本:

$ DISPLAY='' dropbox start -i

您将在控制台而不是 GTK 窗口中收到消息。

相关内容