[英]moduleNotFoundError: No module named in visual studio code
I am new into python and I copied a folder from someone to try.我是 python 的新手,我从某人那里复制了一个文件夹来尝试。 I import a whole folder with subfolders into a workspace from visual studio code.我将带有子文件夹的整个文件夹从 Visual Studio 代码导入工作区。
the subfolder named algorithm has an init .py file which imports all the sub files(for example a file named calculation) In the main file I'm trying to run is: import algorithm as alg名为 algorithm 的子文件夹有一个init .py 文件,它导入所有子文件(例如名为计算的文件) 在我试图运行的主文件中是:import algorithm as alg
all functions are recognized inside visual studio code when using alg.使用 alg 时,所有函数都在 Visual Studio 代码中被识别。 but when I try to run it, it still saying that the module is not found?但是当我尝试运行它时,它仍然说找不到模块? error message错误信息
What did I forget?我忘记了什么? thanks in advance提前致谢
Algorithm is a module that need you to install manually.算法是一个需要你手动安装的模块。
Open an integrated Terminal and if you're using virtual environment, activating it then installing the module.打开一个集成终端,如果您使用的是虚拟环境,请激活它然后安装模块。 About how to activate environment, please view Python Environments .关于如何激活环境,请查看Python Environments 。 Run pip install algorithm
to install:运行pip install algorithm
安装:
Then the import error should be resolved.然后应该解决导入错误。 If no module named algorithm
still exists, run pip show algorithm
to get its location and check if you've installed the module in current selected interpreter.如果仍然不存在no module named algorithm
,请运行pip show algorithm
以获取其位置并检查您是否已在当前选择的解释器中安装了该模块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.