2016-12-05 63 views
0

由於某種原因,每當我在Pycharm中鍵入virtualenvwrapper命令WORKON時,都會收到「未找到命令」錯誤。這將重複發生,直到我輸入source ~/.bashrc每個新的終端會話在Pycharm。正常終端會話按預期行事。必須每次爲virtualenvwrapper工作,爲什麼?/ .bashrc?

這些都是我的〜/ .bashrc文件的內容:

export WORKON_HOME=$HOME/.virtualenvs 
source /usr/local/bin/virtualenvwrapper.sh 

就是這種自然行爲,任何方式每次都需要輸入這個命令源?

+0

[此帖](http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash- profile-and-environment)會給你不同shell之間的一些區別,但是特別的一行可能很重要,因爲你使用'pycharm'就是這樣 - **'bash'使這個變得複雜了,因爲'.bashrc'只是由交互式和非登錄的shell讀取** – Craicerjack

回答

1

有關.bashrc.bash_profile之間區別的詳細說明,請參見此blog

TL; DR,以下內容添加到您的.bash_profile

if [ -f ~/.bashrc ]; then 
    source ~/.bashrc 
fi 
相關問題