Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Visual Studio to respect folders in the PYTHONPATH?

I have a Visual Studio python project and I would like to use IntelliSense to help me when working with files from a folder I added to the User-Account PYTHONPATH. In iPython I can use tab completion for this folder without issues. However, in VisualStudio it keeps telling me that IntelliSense may be missing for the module I try to include.

Are there any settings I have to set for Visual Studio to include those folders added to PYTHONPATH?

  • Visual Studio 2017
  • Anaconda 4.3.0
  • Windows 10
like image 756
NOhs Avatar asked Dec 12 '25 03:12

NOhs


1 Answers

There is a setting in: Tools > Options > Python Tools > Ignore system-wide python path.

Although this appears to have no effect for me, I think this is the option which would do what we both want.

When using a visual studio ipython terminal

import os

print(os.environ['PYTHONPATH'])

A key error is raised, while with a normal ipython terminal outside of VS, the path is correctly printed.

like image 174
duncan betts Avatar answered Dec 14 '25 09:12

duncan betts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!