在Linux中安装Flutter时出错

时间:2018-07-03 03:33:20

标签: flutter

我设置路径变量并回显路径,它会给我预期的输出

uttu@Lore-UK:~/flutter$ export PATH=`pwd`/flutter/bin:$PATH
uttu@Lore-UK:~/flutter$ echo $PATH
/home/uttu/flutter/flutter/bin:/home/uttu/home/flutter/bin:/home/uttu/flutter/flutter/bin:/home/uttu/home/flutter/bin:/home/uttu/.local/share/umake/bin:/home/uttu/bin:/home/uttu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

但是当我跑扑医生时,它显示

$ flutter doctor
Traceback (most recent call last):
  File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
    from _gdbm import *
ImportError: No module named '_gdbm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
    import dbm.gnu as gdbm
  File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
    raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 27, in <module>
    from CommandNotFound.util import crash_guard
  File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
    from CommandNotFound.CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
    import gdbm
ImportError: No module named 'gdbm'

我无法理解为什么会收到此错误以及如何解决该错误

提前谢谢

1 个答案:

答案 0 :(得分:0)

您会在错误消息中看到,您缺少模块“ gdbm”,如此处所示:

  

请安装python3-gdbm软件包

尝试安装此模块,然后再次运行Flutter Doctor。 其他人也有同样的问题Here