Intellisense not working for Unreal in Visual Studio Code

Viewed 587

I've been starting to dabble with automating the unreal engine with python and visual studio code recently. I bought a udemy course on the basics and within the first few videos it has you download unreal engine, go through a few settings in that for setting up python, etc. and then you download visual studio code.

It really doesn't go into too many details in vs code outside of just installing the python extension. Then the guy creates a basic file where he imports unreal and logs "Hello World". When he imports unreal it doesn't give him any issues but when I do it vs code is yelling at me and I have no idea why.

I've watched the videos multiple times to see if I missed a step and I can't seem to find anything that I may have missed.

This is currently what it looks like: enter image description here

I was able to go into unreal engine and execute this python script so that looks to be "functioning" but without intellisense working at all this just seems like a huge PITA.

2 Answers

Type this in your terminal in vscode.

pip install unreal

You don't necessarily have to install unreal globally, in VSCode if you have the Python extension installed you can just link the python path in your project:

enter image description here

For example:

"python.autoComplete.extraPaths": [
    "D:\\Git\\Projects\\MyProject\\Intermediate\\PythonStub"
],

P.S. You need to have the python scripting plugin enabled in your project.

enter image description here

P.P.S. If you want to call python scripts from the console you can also add an additional path in "project settings", in this way you can type "MyScript.py" instead of "D:/OneDrive/Unreal/PythonScripts/MyScript.py"

Related