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 環境(包括 root 環境),並將其運行為“sudo dropbox start -i”

答案2

您可以跳過 GTK 介面,這將避免載入此gi模組。運行保管箱腳本:

$ DISPLAY='' dropbox start -i

您將在控制台而不是 GTK 視窗中收到訊息。

相關內容