activate 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # This file must be used with "source bin/activate" *from bash*
  2. # you cannot run it directly
  3. if [ "${BASH_SOURCE-}" = "$0" ]; then
  4. echo "You must source this script: \$ source $0" >&2
  5. exit 33
  6. fi
  7. deactivate () {
  8. unset -f pydoc >/dev/null 2>&1 || true
  9. # reset old environment variables
  10. # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
  11. if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
  12. PATH="$_OLD_VIRTUAL_PATH"
  13. export PATH
  14. unset _OLD_VIRTUAL_PATH
  15. fi
  16. if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
  17. PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
  18. export PYTHONHOME
  19. unset _OLD_VIRTUAL_PYTHONHOME
  20. fi
  21. if ! [ -z "${_OLD_VIRTUAL_TCL_LIBRARY+_}" ]; then
  22. TCL_LIBRARY="$_OLD_VIRTUAL_TCL_LIBRARY"
  23. export TCL_LIBRARY
  24. unset _OLD_VIRTUAL_TCL_LIBRARY
  25. fi
  26. if ! [ -z "${_OLD_VIRTUAL_TK_LIBRARY+_}" ]; then
  27. TK_LIBRARY="$_OLD_VIRTUAL_TK_LIBRARY"
  28. export TK_LIBRARY
  29. unset _OLD_VIRTUAL_TK_LIBRARY
  30. fi
  31. # The hash command must be called to get it to forget past
  32. # commands. Without forgetting past commands the $PATH changes
  33. # we made may not be respected
  34. hash -r 2>/dev/null
  35. if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
  36. PS1="$_OLD_VIRTUAL_PS1"
  37. export PS1
  38. unset _OLD_VIRTUAL_PS1
  39. fi
  40. unset VIRTUAL_ENV
  41. unset VIRTUAL_ENV_PROMPT
  42. if [ ! "${1-}" = "nondestructive" ] ; then
  43. # Self destruct!
  44. unset -f deactivate
  45. fi
  46. }
  47. # unset irrelevant variables
  48. deactivate nondestructive
  49. if [ ! -d 'C:\Users\Zhuanz\Desktop\AIStoryBoard\python\venv' ]; then
  50. echo "Virtual environment directory 'C:\Users\Zhuanz\Desktop\AIStoryBoard\python\venv' does not exist!" >&2
  51. CURRENT_PATH=$(realpath "${0}")
  52. CURRENT_DIR=$(dirname "${CURRENT_PATH}")
  53. VIRTUAL_ENV="$(realpath "${CURRENT_DIR}/../")"
  54. else
  55. VIRTUAL_ENV='C:\Users\Zhuanz\Desktop\AIStoryBoard\python\venv'
  56. fi
  57. if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then
  58. VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
  59. fi
  60. export VIRTUAL_ENV
  61. _OLD_VIRTUAL_PATH="$PATH"
  62. PATH="$VIRTUAL_ENV/"Scripts":$PATH"
  63. export PATH
  64. if [ "x"'' != x ] ; then
  65. VIRTUAL_ENV_PROMPT=''
  66. else
  67. VIRTUAL_ENV_PROMPT=$(basename "$VIRTUAL_ENV")
  68. fi
  69. export VIRTUAL_ENV_PROMPT
  70. # unset PYTHONHOME if set
  71. if ! [ -z "${PYTHONHOME+_}" ] ; then
  72. _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
  73. unset PYTHONHOME
  74. fi
  75. if [ '' != "" ]; then
  76. if ! [ -z "${TCL_LIBRARY+_}" ] ; then
  77. _OLD_VIRTUAL_TCL_LIBRARY="$TCL_LIBRARY"
  78. fi
  79. TCL_LIBRARY=''
  80. export TCL_LIBRARY
  81. fi
  82. if [ '' != "" ]; then
  83. if ! [ -z "${TK_LIBRARY+_}" ] ; then
  84. _OLD_VIRTUAL_TK_LIBRARY="$TK_LIBRARY"
  85. fi
  86. TK_LIBRARY=''
  87. export TK_LIBRARY
  88. fi
  89. if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
  90. _OLD_VIRTUAL_PS1="${PS1-}"
  91. PS1="(${VIRTUAL_ENV_PROMPT}) ${PS1-}"
  92. export PS1
  93. fi
  94. # Make sure to unalias pydoc if it's already there
  95. alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true
  96. pydoc () {
  97. python -m pydoc "$@"
  98. }
  99. # The hash command must be called to get it to forget past
  100. # commands. Without forgetting past commands the $PATH changes
  101. # we made may not be respected
  102. hash -r 2>/dev/null || true