Two approaches to setup Pyspark in an IDE are :
Using Pip i.e pip install pyspark , As mentioned in the following link ( E0401:Unable to import 'pyspark in VSCode in Windows 10)
By appending PySpark modules in "PYTHONPATH" path, as mentioned in following articles.
The second approach is backward compatible and can be setup in most IDEs, So wanted to know how can one setup up "PYTHONPATH" in visual studio code .
I believe something needs to be done either in settings.json , launch.json or may be even in .env file. But I could not find something concrete.
Also, I went through the visual studio code at link https://code.visualstudio.com/docs/python/environments#_use-of-the-pythonpath-variable . However was still not able to figure out
How to "append" python or PySpark modules to PYTHONPATH
If you want to do it via a .env
file then it should be:
PYTHONPATH=/path/to/zip