Am Implementing a Flask Webapp that requires a virtual Environment to manage dependencies. I have created a virtual environment called venv
. I am Using a Bash Terminal on Visual Studio Code.When I spawn a new bash Terminal at first without logging in the, the Bash commands work perfectly
Admin@blahblah MINGW64 ~/techblog/venv/Scripts (main)$ lsactivate deactivate.bat pasteurize.exe* python.exe* activate.bat flask.exe* pip.exe* pythonw.exe*Activate.ps1 futurize.exe* pip3.11.exe*alembic.exe* mako-render.exe* pip3.exe*
Then I activate it using the command;
Admin@blahblah MINGW64 ~/techblog/venv/Scripts (main)$ cd ../..Admin@blahblah MINGW64 ~/techblog (main)$ source venv/Scripts/activate
The moment I am within the environment the Bash commands do not work.
Admin@blahblah MINGW64 ~/techblog$ clearbash: clear: command not found(venv) Admin@blahblah MINGW64 ~/techblog$ lsbash: ls: command not found(venv)
Also when I exit the same environment I find that the Subsequent bash commands to the Terminal Itself do Not work.
This is the Bash venv/Scripts/activate
script contents;
# This file must be used with "source bin/activate" *from bash*# you cannot run it directlydeactivate () { # reset old environment variables if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then PATH="${_OLD_VIRTUAL_PATH:-}" export PATH unset _OLD_VIRTUAL_PATH fi if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" export PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME fi # This should detect bash and zsh, which have a hash command that must # be called to get it to forget past commands. Without forgetting # past commands the $PATH changes we made may not be respected if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then hash -r 2> /dev/null fi if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then PS1="${_OLD_VIRTUAL_PS1:-}" export PS1 unset _OLD_VIRTUAL_PS1 fi unset VIRTUAL_ENV unset VIRTUAL_ENV_PROMPT if [ ! "${1:-}" = "nondestructive" ] ; then # Self destruct! unset -f deactivate fi}# unset irrelevant variablesdeactivate nondestructiveVIRTUAL_ENV="C:\path\to\my\web\app\techblog\venv"export VIRTUAL_ENV_OLD_VIRTUAL_PATH="$PATH"PATH="$VIRTUAL_ENV/Scripts:$PATH"export PATH# unset PYTHONHOME if set# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)# could use `if (set -u; : $PYTHONHOME) ;` in bashif [ -n "${PYTHONHOME:-}" ] ; then _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" unset PYTHONHOMEfiif [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then _OLD_VIRTUAL_PS1="${PS1:-}" PS1="(venv) ${PS1:-}" export PS1 VIRTUAL_ENV_PROMPT="(venv) " export VIRTUAL_ENV_PROMPTfi# This should detect bash and zsh, which have a hash command that must# be called to get it to forget past commands. Without forgetting# past commands the $PATH changes we made may not be respectedif [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then hash -r 2> /dev/nullfi
what am I missing or where am I going wrong?