activate 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. # Call hash to forget past locations. Without forgetting
  16. # past locations the $PATH changes we made may not be respected.
  17. # See "man bash" for more details. hash is usually a builtin of your shell
  18. hash -r 2> /dev/null
  19. if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
  20. PS1="${_OLD_VIRTUAL_PS1:-}"
  21. export PS1
  22. unset _OLD_VIRTUAL_PS1
  23. fi
  24. unset VIRTUAL_ENV
  25. unset VIRTUAL_ENV_PROMPT
  26. if [ ! "${1:-}" = "nondestructive" ] ; then
  27. # Self destruct!
  28. unset -f deactivate
  29. fi
  30. }
  31. # unset irrelevant variables
  32. deactivate nondestructive
  33. # on Windows, a path can contain colons and backslashes and has to be converted:
  34. case "$(uname)" in
  35. CYGWIN*|MSYS*|MINGW*)
  36. # transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
  37. # and to /cygdrive/d/path/to/venv on Cygwin
  38. VIRTUAL_ENV=$(cygpath 'C:\Users\Zhuanz\Desktop\AIStoryBoard\python\system_venv')
  39. export VIRTUAL_ENV
  40. ;;
  41. *)
  42. # use the path as-is
  43. export VIRTUAL_ENV='C:\Users\Zhuanz\Desktop\AIStoryBoard\python\system_venv'
  44. ;;
  45. esac
  46. _OLD_VIRTUAL_PATH="$PATH"
  47. PATH="$VIRTUAL_ENV/"Scripts":$PATH"
  48. export PATH
  49. VIRTUAL_ENV_PROMPT='(system_venv) '
  50. export VIRTUAL_ENV_PROMPT
  51. # unset PYTHONHOME if set
  52. # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
  53. # could use `if (set -u; : $PYTHONHOME) ;` in bash
  54. if [ -n "${PYTHONHOME:-}" ] ; then
  55. _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
  56. unset PYTHONHOME
  57. fi
  58. if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
  59. _OLD_VIRTUAL_PS1="${PS1:-}"
  60. PS1="("'(system_venv) '") ${PS1:-}"
  61. export PS1
  62. fi
  63. # Call hash to forget past commands. Without forgetting
  64. # past commands the $PATH changes we made may not be respected
  65. hash -r 2> /dev/null