I have a file called setup.sh which basically has this
python3 -m venv env
source ./env/bin/activate
# other setup stuff
When I run sh setup.sh, the environment folder env is created, and it will run my #other setup stuff, but it will skip over source ./env/bin/activate, which puts me in my environment.
The command runs just fine if I do so in the terminal(I have a macbook), but not in my bash file.
Three ideas I've tried:
- ensuring execute priviges:
chmod +x setup.sh - change the line
source ./env/bin/activateto. ./env/bin/activate - run the file using
bash setup.shinstead ofsh setup.sh
Is there a smarter way to go about being put in my environment, or some way I can get the source to run?