activate 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 commands. Without forgetting
  16. # past commands the $PATH changes we made may not be respected
  17. hash -r 2> /dev/null
  18. if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
  19. PS1="${_OLD_VIRTUAL_PS1:-}"
  20. export PS1
  21. unset _OLD_VIRTUAL_PS1
  22. fi
  23. unset VIRTUAL_ENV
  24. unset VIRTUAL_ENV_PROMPT
  25. if [ ! "${1:-}" = "nondestructive" ] ; then
  26. # Self destruct!
  27. unset -f deactivate
  28. fi
  29. }
  30. # unset irrelevant variables
  31. deactivate nondestructive
  32. VIRTUAL_ENV=/Users/max_liu/max_liu/company/Agent/.venv311
  33. export VIRTUAL_ENV
  34. _OLD_VIRTUAL_PATH="$PATH"
  35. PATH="$VIRTUAL_ENV/"bin":$PATH"
  36. export PATH
  37. # unset PYTHONHOME if set
  38. # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
  39. # could use `if (set -u; : $PYTHONHOME) ;` in bash
  40. if [ -n "${PYTHONHOME:-}" ] ; then
  41. _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
  42. unset PYTHONHOME
  43. fi
  44. if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
  45. _OLD_VIRTUAL_PS1="${PS1:-}"
  46. PS1='(.venv311) '"${PS1:-}"
  47. export PS1
  48. VIRTUAL_ENV_PROMPT='(.venv311) '
  49. export VIRTUAL_ENV_PROMPT
  50. fi
  51. # Call hash to forget past commands. Without forgetting
  52. # past commands the $PATH changes we made may not be respected
  53. hash -r 2> /dev/null