Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

activate 2.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  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. # on Windows, a path can contain colons and backslashes and has to be converted:
  33. if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
  34. # transform D:\path\to\venv to /d/path/to/venv on MSYS
  35. # and to /cygdrive/d/path/to/venv on Cygwin
  36. export VIRTUAL_ENV=$(cygpath "/workspace/fedora-llm-docs/new_env")
  37. else
  38. # use the path as-is
  39. export VIRTUAL_ENV="/workspace/fedora-llm-docs/new_env"
  40. fi
  41. _OLD_VIRTUAL_PATH="$PATH"
  42. PATH="$VIRTUAL_ENV/bin:$PATH"
  43. export PATH
  44. # unset PYTHONHOME if set
  45. # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
  46. # could use `if (set -u; : $PYTHONHOME) ;` in bash
  47. if [ -n "${PYTHONHOME:-}" ] ; then
  48. _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
  49. unset PYTHONHOME
  50. fi
  51. if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
  52. _OLD_VIRTUAL_PS1="${PS1:-}"
  53. PS1="(new_env) ${PS1:-}"
  54. export PS1
  55. VIRTUAL_ENV_PROMPT="(new_env) "
  56. export VIRTUAL_ENV_PROMPT
  57. fi
  58. # Call hash to forget past commands. Without forgetting
  59. # past commands the $PATH changes we made may not be respected
  60. hash -r 2> /dev/null
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...