Python related simple shell scripting issue - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: Python related simple shell scripting issue (/thread-15530.html) |
Python related simple shell scripting issue - Larz60+ - Jan-20-2019 I have a whole bunch of old projects that were created without virtual environment. many of them use the same packages, so I thought I'd create a bash script to:
Everything works until I get to step 5 (deactivate) The command executes, but when the script exits, the virtual environment is still running My bash shell programming skills are very rusty, so what am I doing wrong? script: #!/bin/bash python -m venv venv . ./venv/bin/activate cat > ./venv/requirements.txt << EOM lxml requests pylint BeautifulSoup4 selenium EOM pip install -r ./venv/requirements.txt cp -r ../../../A-D/D/drivers/chromedriver ./venv/bin/chromedriver cp -r ../../../A-D/D/drivers/geckodriver ./venv/bin/geckodriver . deactivate RE: Python related simple shell scripting issue - mlieqo - Jan-20-2019 Maybe just instead of: . deactivatetry: deactivate RE: Python related simple shell scripting issue - Larz60+ - Jan-20-2019 That works fine. Thank You! RE: Python related simple shell scripting issue - DeaD_EyE - Jan-20-2019 I guess deactivate is created as alias. RE: Python related simple shell scripting issue - Larz60+ - Jan-20-2019 It is, when executing activate |