2

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 Answers2

3

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

JialeDu
  • 6,021
  • 2
  • 5
  • 24
-1

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

Andy Z
  • 406
  • 3
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 03 '22 at 20:13
  • I have the same issue and this did not resolve it, I am already on the newest version and it is the only version that I have. So, I have the same issue where vs code won't recognise manim, but I can run manim code through the terminal. – Miika Vuorio Jun 05 '22 at 12:28
  • when select the Python interpreter in the pull down menu, select the python3. you may need to close vc and reopen it again – Andy Z Jun 06 '22 at 17:42