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.
Press Ctrl+Alt+S to open the IDE settings and select Tools | External Tools. button to add a new external tool.
So back to your question, when you create an env in Pycharm, it will ask you which env do you want to create: Virtualenv Environment , Conda Environment , or Pipenv Environment . As for me, I usually choose Pipenv Environment as this env will be bound to the current project and can generate a lock file.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With