Visual Studio Code - How to add multiple paths to python path?

前端 未结 7 733
我在风中等你
我在风中等你 2020-12-04 12:40

I am experimenting with Visual Studio Code and so far, it seems great (light, fast, etc).

I am trying to get one of my Python apps running that uses a virtual enviro

7条回答
  •  一个人的身影
    2020-12-04 12:51

    I had the same issue, malbs answer doesn't work for me until I change semicolon to a colon,you can find it from ZhijiaCHEN's comments

    "env": { "PYTHONPATH": "/path/to/a:/path/to/b" }
    

    Alternatively, I have a hack way to achieve the same:

    # at the top of project app script:
    import sys
    sys.path.append('/path/to/a')
    sys.path.append('/path/to/b')
    

提交回复
热议问题