Editing 1987: Python Environment

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 19: Line 19:
  
 
;$PATH
 
;$PATH
:$PATH refers to the {{w|PATH (variable)|PATH}} environment variable, which determines where to search for executable files. In this case, it indicates that the pip, Homebrew Python (2.7), and macOS's pre-installed Python are accessible on path, with ~/newenv/ and a mysterious ???? as part of PATH.
+
:$PATH refers to the {{w|PATH (variable)|PATH}} environment variable, which determines where to search for executable files. In this case, it indicates that the pip, Homebrew Python (2.7), and OSX's pre-installed Python are accessible on path, with ~/newenv/ and a mysterious ???? as part of PATH.
 
;pip
 
;pip
 
:{{w|pip (package manager)|pip}} is the Python {{w|package management system}}, and is used to install and manage python packages. As it is written in Python, it requires Python to run. It leads to easy_install, Homebrew Python (2.7), "(misc folders owned by root)", and ????.
 
:{{w|pip (package manager)|pip}} is the Python {{w|package management system}}, and is used to install and manage python packages. As it is written in Python, it requires Python to run. It leads to easy_install, Homebrew Python (2.7), "(misc folders owned by root)", and ????.
 
;Homebrew Python (2.7)
 
;Homebrew Python (2.7)
:{{w|Homebrew (package management software)|Homebrew}} is a third-party macOS package manager. Homebrew Python (2.7) is the Python 2 version installed through Homebrew. This leads to Python.org binary (2.6) and /usr/local/Cellar.
+
:{{w|Homebrew (package management software)|Homebrew}} is the de facto standard third-party OSX package manager. Homebrew Python (2.7) is the Python 2 version installed through Homebrew. This leads to Python.org binary (2.6) and /usr/local/Cellar.
 
;OS Python
 
;OS Python
:Apple bundles an (out of date) version of Python with macOS. This only leads to ????.
+
:Apple bundles an (out of date) version of Python with OSX. This only leads to ????.
 
;????
 
;????
 
:With so many versions of Python installed and used in the system, it becomes very hard to track which Python program uses which version and environment. The system becomes unpredictable and its workings and faults mysterious. All parts of the graph that lead to this point, lead to confusion.
 
:With so many versions of Python installed and used in the system, it becomes very hard to track which Python program uses which version and environment. The system becomes unpredictable and its workings and faults mysterious. All parts of the graph that lead to this point, lead to confusion.
Line 41: Line 41:
 
:The default (normal) location of the {{w|Homebrew (package management software)|Homebrew}} Cellar, the directory where Homebrew actually stores the files of the installed packages. It's a storage-only location, the files, including Python, will be symlinked from other, more convenient places in the files tree, and should not be used through /usr/local/Cellar path directly. It seems that Randall broke this safety rule in the past, so some stuff of his accesses Python directly in the Cellar. Such setup can break if Homebrew performs automatic maintenance in the Cellar (like removing unneeded versions of the packages). The name cellar is likely a reference to the practice of storing wines and other alcohol in cellars, intended as a pun of homebrew.
 
:The default (normal) location of the {{w|Homebrew (package management software)|Homebrew}} Cellar, the directory where Homebrew actually stores the files of the installed packages. It's a storage-only location, the files, including Python, will be symlinked from other, more convenient places in the files tree, and should not be used through /usr/local/Cellar path directly. It seems that Randall broke this safety rule in the past, so some stuff of his accesses Python directly in the Cellar. Such setup can break if Homebrew performs automatic maintenance in the Cellar (like removing unneeded versions of the packages). The name cellar is likely a reference to the practice of storing wines and other alcohol in cellars, intended as a pun of homebrew.
 
;<code>/usr/local/opt</code>
 
;<code>/usr/local/opt</code>
:A folder that is usually created by Homebrew.
+
:Both <code>/usr/local</code> and <code>/opt</code> are directories that store files that are not maintained by the standard package management system of a Unix-like operating system. Usually, files in <code>/usr/local</code> were created with a {{w|make (software)|make command}}, and files in <code>/opt</code> are unbundled packages. The joke is that <code>/usr/local/opt</code> should really, really not exist.
 
;/(A bunch of paths with "Frameworks" in them somewhere)/
 
;/(A bunch of paths with "Frameworks" in them somewhere)/
:Python on macOS is often distributed as a framework and placed in a "Frameworks" folder. For example, the system-included Python distribution in macOS resides in /System/Library/Frameworks, and many package managers will also install the framework in a folder with this name.
+
:The system-included Python distribution in macOS resides in /System/Library/Frameworks
 
;$PYTHONPATH
 
;$PYTHONPATH
 
:The environment variable PYTHONPATH specifies the search path for Python modules to the Python interpreter. Having it refer to locations controlled by 3 different package managers, each of which is managing software for different versions of Python, as shown, is likely to lead to incompatible software being loaded together.
 
:The environment variable PYTHONPATH specifies the search path for Python modules to the Python interpreter. Having it refer to locations controlled by 3 different package managers, each of which is managing software for different versions of Python, as shown, is likely to lead to incompatible software being loaded together.

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)