简体   繁体   中英

Pycharm External tools relative to Virtual Environment

Using the PyCharm IDE, when setting up an external tool, how can you set up the external tools with a path relative to use the current virtual env defaults.?

An example being pylint - where I'd want the virtual env version and not the system one to run.

Not sure about older versions, but in PyCharm 5 one can use $PyInterpreterDirectory$ macro. It's exactly that we want

There's JDKPath macro you can use which points to the executable of the interpreter set for a project. You can combine this with the fact that many tools can be run by directly running their module(s) using the -m option of interpreter. Also there's issue PY-2734 New useful macros in external tools everyone can vote on.

just found your post while looking for documentation about the "variables" that could bew used when setting parameters for external tools.

No documentation but you can see a list of all the available stuff after pressing thE "INSERT MACRO" button in the Edit Tool dialog.

I don't see any reference to the interpreter path there but I usually use the virtualenv as my project path. If you are doing that too you could infer the python interpreter path from there.

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