activate 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # This file must be used with "source bin/activate" *from bash*
  2. # you cannot run it directly
  3. deactivate () {
  4. # reset old environment variables
  5. if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
  6. PATH="${_OLD_VIRTUAL_PATH:-}"
  7. export PATH
  8. unset _OLD_VIRTUAL_PATH
  9. fi
  10. if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
  11. PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
  12. export PYTHONHOME
  13. unset _OLD_VIRTUAL_PYTHONHOME
  14. fi
  15. # This should detect bash and zsh, which have a hash command that must
  16. # be called to get it to forget past commands. Without forgetting
  17. # past commands the $PATH changes we made may not be respected
  18. if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
  19. hash -r 2> /dev/null
  20. fi
  21. if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
  22. PS1="${_OLD_VIRTUAL_PS1:-}"
  23. export PS1
  24. unset _OLD_VIRTUAL_PS1
  25. fi
  26. unset VIRTUAL_ENV
  27. unset VIRTUAL_ENV_PROMPT
  28. if [ ! "${1:-}" = "nondestructive" ] ; then
  29. # Self destruct!
  30. unset -f deactivate
  31. fi
  32. }
  33. # unset irrelevant variables
  34. deactivate nondestructive
  35. VIRTUAL_ENV="C:\Users\User\Desktop\flask_api_demo\venv"
  36. export VIRTUAL_ENV
  37. _OLD_VIRTUAL_PATH="$PATH"
  38. PATH="$VIRTUAL_ENV/Scripts:$PATH"
  39. export PATH
  40. # unset PYTHONHOME if set
  41. # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
  42. # could use `if (set -u; : $PYTHONHOME) ;` in bash
  43. if [ -n "${PYTHONHOME:-}" ] ; then
  44. _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
  45. unset PYTHONHOME
  46. fi
  47. if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
  48. _OLD_VIRTUAL_PS1="${PS1:-}"
  49. PS1="(venv) ${PS1:-}"
  50. export PS1
  51. VIRTUAL_ENV_PROMPT="(venv) "
  52. export VIRTUAL_ENV_PROMPT
  53. fi
  54. # This should detect bash and zsh, which have a hash command that must
  55. # be called to get it to forget past commands. Without forgetting
  56. # past commands the $PATH changes we made may not be respected
  57. if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
  58. hash -r 2> /dev/null
  59. fi