To clarify I have read these questions already:
How to source virtualenv activate in a Bash script
How to activate python virtual environment by shell script
Activating virtualenv in Bash script not working
Bash: How _best_ to include other scripts?
My goal is to create a script that will automate the process of installing several (roughly 27) python packages via pip in a virtual environment using (preferably) a bash script.
So far in bash scripts I have tried:
source env/bin/activate
pip install numpy Scipy ez_setup
As well as
activate() {
. ../.env/bin/activate
}
activate
pip install numpy Scipy ez_setup
Neither of which works. What is the best way to approach this problem given it must be executable as part of a larger bash (or python) script?
source env/bin/activateshould work - is there any output? The name of the venv should appear in brackets prepended to your terminal prompt. It's possible you may have to executescl enable python27 bashif you are in a remote environment.