2

I'm trying to run a python task within run/debug configuration task option.

My problem is that I need to load some environment variables from a bash script.

In my normal terminal is as simple as <source file.sh> and then I can execute my script without any problem.

I already tried doing a external tool (to execute the sh file) an put on "before launch" option inside run/debug configuration

but did not work.

Any ideas/help?

Miknotauro
  • 31
  • 4
  • Possible duplicate of [How to set environment variables in PyCharm?](https://stackoverflow.com/questions/42708389/how-to-set-environment-variables-in-pycharm) – lmiguelvargasf Jul 24 '18 at 22:46

1 Answers1

0

You could set the environment variables before starting PyCharm. This way, they should propagate to processes launched by PyCharm, and you c an re-use the existing bash script.

But if you can put the environment variable settings into a file of the appropriate format, the EnvFile suggestion in this answer appears to be a good solution.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92