# pvpython in vscode

**URL:** https://discourse.paraview.org/t/pvpython-in-vscode/12925
**Category:** Development
**Tags:** python
**Created:** [September 25, 2023, 9:36pm UTC](https://discourse.paraview.org/t/pvpython-in-vscode/12925 "2023-09-25T21:36:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PombearView](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@PombearView](https://discourse.paraview.org/u/PombearView)
#### Post date: [September 25, 2023, 9:36pm UTC](https://discourse.paraview.org/t/pvpython-in-vscode/12925/1 "2023-09-25T21:36:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mdev](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/45deac/32.png) [@mdev](https://discourse.paraview.org/u/mdev)
#### Post date: [June 29, 2024, 5:26pm UTC](https://discourse.paraview.org/t/pvpython-in-vscode/12925/2 "2024-06-29T17:26:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![PombearView](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@PombearView](https://discourse.paraview.org/u/PombearView)
#### Post date: [June 29, 2024, 6:06pm UTC](https://discourse.paraview.org/t/pvpython-in-vscode/12925/3 "2024-06-29T18:06:30Z")

</div>

try the following, fyi i still didnt get debug to work though - if you manage, please let me know 🙂  
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}”  
]

---

<div class="post-metadata">

### Author: ![PombearView](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@PombearView](https://discourse.paraview.org/u/PombearView)
#### Post date: [June 29, 2024, 6:12pm UTC](https://discourse.paraview.org/t/pvpython-in-vscode/12925/4 "2024-06-29T18:12:31Z")

</div>

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.
