简体   繁体   中英

Python path in VS Code on Linux

So, this has been covered a number of times already, and there's some good documentation on how things are supposed to work here . Except: nothing seems to work for me, How do I debug this? what am I missing: I've tried the following things:

  • set PYTHONPATH in .env in the root of my workspace
  • add "python.envFile": ".env" to .vscode/settings.json
  • move .env to .vscode/env , update python.envFile to reflect
  • remove all the env business, add python.autoComplete.extraPaths to .vscode/settings.json
  • use a workspace config with a settings key, repeat the steps above
  • just give in and run PYTHONPATH=directory code.

All of the above is completely ignored, pylint keeps on complaining. I am getting a bit frustrated. What am I missing here!

Right, cause found. Even outside of VS Code pylint was acting up. Source of the problem: the top-level dir also contained an __init__.py file, messing up all sorts of things. Remove that file and it starts working...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM