简体   繁体   中英

.bash_profile read in the terminal but not in PyCharm

very simple python run through in Terminal python, but failed in PyCharm. Based on the message, the PATH I defined in the .bash_profile is not passed in PyCharm. How do I let PyCharm know these PATH?

The correct result in Terminal Python: 在此处输入图片说明

The failure I see in PyCharm: 在此处输入图片说明

This is what worked for me for a somewhat similar scenario:

  • I copied .bash_profile into .bashrc
  • In Pycharm's Terminal settings, make sure that the 'Shell integration' option is not checked
  • I left 'Shell path' to only have the path to bash (no further --rcfile arguments required)

It may help to add an echo with a custom message in your .bashrc file to confirm if indeed this file is being read

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