简体   繁体   中英

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. I'm using Python 3.10.4 and Manim's last version

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,

在此处输入图像描述

Or use ctrl+shift+p to enter Python:Select Interpreter.

在此处输入图像描述

Another way: add the path to the module in your 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 或任何一个匹配你的版本

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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