pvpython in vscode

Hi all,
I’m looking for best tips on setting up a development environment for coding pvpython in vscode.
Ideally have linting for paraview (by setting the paths to the paraview site-packages and Lib i can autocomplete:
import paraview.simple as pv
pv.AddLight()

but i cannot autocomple:
pv.CellDataToPointData()

Also I seem unable to debug using breakpoints in vs code. After setting the interpreter to pvpython, I can run normally, but i cannot run in debug (debugger exits quickly, without printing to any terminal).

thanks for any advice.

Next steps i’ll try compiling paraview rather than using a pre-compiled binary.

Hello,

How did you set the python path to the paraview site-package?

I am trying to make a project in VS code which uses paraview pvpython functions, but I could not solve the error

from paraview.simple import * → no module named ‘paraview’.

Thank you.

try the following, fyi i still didnt get debug to work though - if you manage, please let me know :slight_smile:
I typred the stuff below out, so may have missed a " or a , here and there.
i dont think you need the last 2 entries, i think this was my failed attempt at getting the autocomplete to work.

inside .vscode/settings.json
“terminal.integrated.env.linux”{
“PYTHONPATH”: “{workspacefolder}/src:<path to site packages with paraview>:{env:PYTHONPATH}”
}

“python.autoComplete.extraPaths”:[
{workspacefolder}/src", <path to site packages with paraview>, "{env:PYTHONPATH}”
],
“python.analysis.extraPaths”:[
{workspacefolder}/src", <path to site packages with paraview>, "{env:PYTHONPATH}”
]

i also have pythonpath set in a .env file, and in the vscode settings i have the path to .env set for “Python: Env File”
set to ${workspacefolder}/.env

inside this file i’ve set
PYTHONPATH="./src/::${env:PYTHONPATH}

a tip, if you want vscode to echo out what it sees as the pythonpath, you can do this by creating a new task and set the command to "echo “$PYTHONPATH”

this is probably all overkill.