I'm trying to follow this SO answer and this blog post to activate my virtualenv automatically in PyCharm's Terminal (no need for source path, etc..
). The difference in my case is that my virtualenv folder resides in my project's root folder, and that's where I want the shell --rcfile to be as well.
(Note: this isn't about how to integrate a virtualenv in project, I've already done that)
After many retries, I got it to work, however with a quibble that I'm not sure that I should live with. Here are my configurations:
My virtualenv lives in a
/venv/
directory at the root folder of my project (calledproject1
).My shell rcfile (at
user/learnp/project1
) override file looks like this:source ~/.bashrc source ~/learnp/project1/venv/bin/activate
In PyCharm Preferences → Tools → Terminal, my
Shell Path
adjustment looks like this:/bin/bash --rcfile ~/learnp/project1/h.pycharm-bash
[previously: /bin/bash]
When I launch my Terminal in PyCharm, this is what I see:
bash: /Users/user/.bashrc: No such file or directory (venv)bash-3.2$
So venv is activated, however two things I find worrying is that it's saying there isn't a file name bashrc, and that the prompt is saying bash-3.2
instead of showing the regular Terminal prompt with my username in it.
How can I fix this? what did I do wrong?