繁体   English   中英

导入 Manim 无法解决 Pylance

[英]Import Manim could not be resolved Pylance

当我尝试在 VsCode 上执行此代码时,它给了我这个错误: Import Manim could not besolved Pylance。 我正在使用 Python 3.10.4 和 Manim 的最新版本

from manim import *

class trabalho(Scene):
    def construct(self):

        plane = NumberPlane()
        self.add(plane)

请确保您当前使用的是正确的工作环境(环境设置请参考本文档)。

并且选择了正确的python解释器,您可以通过点击右下角状态栏中显示的当前解释器来更改它,

在此处输入图像描述

或者使用ctrl+shift+p进入Python:选择Interpreter。

在此处输入图像描述

另一种方法:在setting.json中添加模块的路径。 例如:

"python.analysis.extraPaths":[
    // The folder path where the custom module is located, and multiple paths can be added (the following is just an example)
    "E:\\myfolder\\homework\\one\\Person_reID_baseline_pytorch-master" ,
    "E:\\...\\...\\...\\..."     
]

希望这可以帮助你

在 VsCode 中试试这个:(1) ctrl-shift-p (2) 在搜索框中,输入 python 然后选择 Python:选择解释器 (3) 选择 Python 3.10.4 或任何一个匹配你的版本

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM