0

I run Python program which uses couple of source paths on runtime.

I put these rows on my /.bashrc file:

source home/raphael/kaldi/aspire/s5/cmd.sh
source home/raphael/kaldi/aspire/s5/path.sh

So when I'm running from terminal everything works fine and Python manage to locate paths.

However when I'm trying to run through PyCharm for DEBUG purposes mostly it seems that PyCharm can't locate the paths.

Is there anyway to add the paths manually for PyCharm or make it read /.bashrc file. What I am missing?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
RefiPeretz
  • 543
  • 5
  • 19
  • Possible duplicate of [Pycharm environment different than command line](https://stackoverflow.com/questions/19715724/pycharm-environment-different-than-command-line) – Pavel Karateev Mar 17 '18 at 17:32

1 Answers1

1

You can try using the options available in the Run/Debug Configuration settings (Run > Edit Configurations...)

You can set environment variables individually (such as $PATH), or at the bottom is a section to define external tools (scripts) to be run when your Python code is run or debugged. From that sub-section, you could set your bash scripts to be run each time you start debugging.

Alternatively, see if using os.environ would work for your project. Check the docs for more information.

Dito
  • 182
  • 3
  • 12