首页 > 解决方案 > Ubuntu (WSL) Python 与 Python3.7 Microsoft Store 应用程序分开?

问题描述

在 Windows 10 上,以下步骤成功安装并运行 Python-pyfiglet 模块:

但是,当我尝试import pyfiglet通过以下任何其他方式使用时:

  1. Python3.7 Store App(通过Microsoft Store app安装)
  2. Cmd > python3
  3. VSCode > 创建hello_world.py和调试,

不幸的是,这三种方法都导致ModuleNotFoundError: No module named 'pyfiglet'.

为什么import pyfigletWindows Terminal > Ubuntu > Python3都成功,而其他三种打开python的方式都不成功?这些其他版本的 python 是否与 Ubuntu 版本的 python 分开?(我认为它们都是本质上来自 WSL 的相同版本的 python。)

如果它们确实都是单独的 python 安装,并且它们之间没有共享模块,那么如何为 Cmd / Python3.7 Store App / VSCode 版本重新安装(重复)pyfiglet?在 python 的 Cmd / Python3.7 Store App / VSCode 调试版本中尝试sudo apt install python3-pyfiglet或失败。pip install pyfiglet

标签: pythonpython-3.xwindowsubuntuwindows-subsystem-for-linux

解决方案


推荐阅读