简体   繁体   中英

PYTHONPATH in the python process of Sublime Text 2

I tried to get PYTHONPATH in the python process (ex. the console or some packages ) of Sublime Text 2 running "os.environ.get('pythonpath')", but it's empty. It seems not to import only PYTHONPATH from system environment variables. Other variables were imported.

If editing "Python.sublime-build", variables was not imported.

Can I get PYTHONPATH in the process?

Use the env option in your custom Python build system ( documented here ). Basically, you'll want something like this:

"env": {
        "PYTHONPATH":"/my/custom/modules"
       }

Make sure if you are overriding the default Python build rule that you do it in the User folder so that your customization will persist through upgrades.

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