简体   繁体   English

导入 Manim 无法解决 Pylance

[英]Import Manim could not be resolved Pylance

When I try to execute this code on VsCode it gives me this error: Import Manim could not be resolved Pylance.当我尝试在 VsCode 上执行此代码时,它给了我这个错误: Import Manim could not besolved Pylance。 I'm using Python 3.10.4 and Manim's last version我正在使用 Python 3.10.4 和 Manim 的最新版本

from manim import *

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

        plane = NumberPlane()
        self.add(plane)

Please make sure that you are currently using the correct working environment (refer to this document for setting the environment).请确保您当前使用的是正确的工作环境(环境设置请参考本文档)。

and the correct python interpreter is selected, you can change it by clicking on the current interpreter displayed in the status bar in the lower right corner,并且选择了正确的python解释器,您可以通过点击右下角状态栏中显示的当前解释器来更改它,

在此处输入图像描述

Or use ctrl+shift+p to enter Python:Select Interpreter.或者使用ctrl+shift+p进入Python:选择Interpreter。

在此处输入图像描述

Another way: add the path to the module in your setting.json .另一种方法:在setting.json中添加模块的路径。 Eg:例如:

"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:\\...\\...\\...\\..."     
]

Hope this helps you希望这可以帮助你

在 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