Import Manim could not be resolved Pylance

Viewed 247

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)
2 Answers

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,

enter image description here

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

enter image description here

Another way: add the path to the module in your setting.json. E.g:

"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

Try this in VsCode: (1) ctrl-shift-p (2) In search box, type python and then select Python: Select Interpreter (3) select Python 3.10.4 or any one matches your verion

Related