Editing 1987: Python Environment
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 4: | Line 4: | ||
| title = Python Environment | | title = Python Environment | ||
| image = python_environment.png | | image = python_environment.png | ||
− | | titletext = The Python environmental protection agency wants to seal it in a cement chamber, with | + | | titletext = The Python environmental protection agency wants to seal it in a cement chamber, with pictoral messages to future civilizations warning them about the danger of using sudo to install random Python packages. |
}} | }} | ||
==Explanation== | ==Explanation== | ||
− | |||
− | + | A development environment is the collection of tools used to create a computer program. It generally includes an {{w|Interpreter_(programming)|interpreter}}, a {{w|package manager}}, and various {{w|Library_(computing)|libraries}} that the project needs. Computer programs often depend on a specific version of these tools, such as a program that only runs on Python 2.7. A badly configured build environment can lead to mysterious errors as the program looks for libraries or features that aren't there, making it hard to develop stable and portable software. | |
− | + | {{w|Python_(programming_language)|Python}} is a {{w|computer}} {{w|programming language}} which has been around for quite a while, especially on {{w|Linux}} platforms. [[Randall]] has shown his fascination with Python [[353: Python|before]]. He has likely used it on his computer for quite a few years, from the early years where it wasn't so easy to install, through newer versions where there is a more defined way to install it. Because standards change over time (in particular, although the newest version of Python is Python 3.x, many people prefer Python 2.x and it's still widely used for backwards-compatibility), and he didn't completely uninstall old versions before installing new versions (likely to not break what was already working), he's ended up with a mess where different pieces and versions of Python and its related components litter his {{w|hard drive}}'s {{w|directory structure}}. | |
{{w|Superfund}} is a US federal government program created for cleaning up contaminated land. The comic is saying that his computer's Python environment is so messed up that it's comparable to a real-world environmental disaster. | {{w|Superfund}} is a US federal government program created for cleaning up contaminated land. The comic is saying that his computer's Python environment is so messed up that it's comparable to a real-world environmental disaster. | ||
− | The title text may refer to the philosophical debate surrounding the construction of warning features around the [[wikipedia:Waste_Isolation_Pilot_Plant#Warning_messages_for_future_humans|WIPP]] site in New Mexico, and other nuclear waste disposal sites. In particular, it may refer to [https://web.archive.org/web/20090320054657/http://www.wipp.energy.gov/picsprog/articles/wipp%20exhibit%20message%20to%2012,000%20a_d.htm this article]. These would have to last and be understandable for tens of thousands of years, longer than any known human-made structure or language to date | + | The title text may refer to the philosophical debate surrounding the construction of warning features around the [[wikipedia:Waste_Isolation_Pilot_Plant#Warning_messages_for_future_humans|WIPP]] site in New Mexico, and other nuclear waste disposal sites. In particular, it may refer to [https://web.archive.org/web/20090320054657/http://www.wipp.energy.gov/picsprog/articles/wipp%20exhibit%20message%20to%2012,000%20a_d.htm this article]. These would have to last and be understandable for tens of thousands of years, longer than any known human-made structure or language to date. |
;$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 | + | :$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 | + | :{{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 | + | :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 | + | :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, its working and faults mysterious. All parts of the graph that lead to this point, lead to confusion. |
;easy_install | ;easy_install | ||
− | :easy_install, much like pip, is a cpan-like tool to download and install Python packages. As of the creation of the comic, many people discourage its use. (e.g., [https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install this question on stack exchange.] | + | :easy_install, much like pip, is a cpan-like tool to download and install Python packages. As of the creation of the comic, many people discourage its use. (e.g., [https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install this question on stack exchange.] |
;Anaconda Python | ;Anaconda Python | ||
− | :{{w|Anaconda (Python distribution)|Anaconda}} is a Python distribution for data science and machine learning | + | :{{w|Anaconda (Python distribution)|Anaconda}} is a Python distribution for data science and machine learning related applications. |
;Homebrew Python (3.6) | ;Homebrew Python (3.6) | ||
− | :As of the creation of the comic, Python 3.6 is the current stable version of Python. It can be installed together with Python 2.7 on the same computer. Care must be taken to use an appropriate version for every Python program, however | + | :As of the creation of the comic, Python 3.6 is the current stable version of Python. It can be installed together with Python 2.7 on the same computer. Care must be taken to use an appropriate version for every Python program, however. |
;Python.org binary (2.6) | ;Python.org binary (2.6) | ||
− | :[http://python.org Python.org] is the home site of the {{w|Python_(programming_language)|Python language}} and provides its reference implementation. Among other stuff, there are downloadable installers that create ready | + | :[http://python.org Python.org] is the home site of the {{w|Python_(programming_language)|Python language}} and provides its reference implementation. Among other stuff, there are downloadable installers that create ready to use Python environments for you (on Windows and macOS only). It makes little sense, however, to use it on a computer where Homebrew, Anaconda and a locally compiled version are already present, since the Python.org version is the baseline one, doesn't give you any benefits, and can't be optimized for your needs. Having an obsolete 2.6 version, when the typically used 2.7 is already on the computer, also doesn't help. Some justified uses do exist (tests, programs that depend on this particular version), but in the end, an extra version of Python just adds to the overall confusion. |
;(Misc folders owned by root) | ;(Misc folders owned by root) | ||
− | :This suggests that over years [[Randall]] dropped various versions of {{w|Python_(programming_language)|Python}} environments everywhere around his computer, probably by hand without proper installers, and used root privileges to do so. The exact locations either are highly nonstandard, so it makes no sense | + | :This suggests that over years [[Randall]] dropped various versions of {{w|Python_(programming_language)|Python}} environments everywhere around his computer, probably by hand without proper installers, and used root privileges to do so. The exact locations either are highly nonstandard, so it makes no sense showing them to us, or have simply been forgotten. Now it's hard to even tell where exactly those Pythons lay, what in the system depends on them, and if it's safe to remove them or not (because if installed by the root, they can integrate into unexpected places in the system; having them can break something, and removing them can break something). |
;<code>/usr/local/Cellar</code> | ;<code>/usr/local/Cellar</code> | ||
− | :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 | + | :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). |
;<code>/usr/local/opt</code> | ;<code>/usr/local/opt</code> | ||
− | : | + | :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)/ | ||
− | : | + | :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. | ||
;Another pip?? | ;Another pip?? | ||
− | :Pip is a {{w|Recursive acronym}} for | + | :Pip is a {{w|Recursive acronym}} for `Pip Installs Packages`. There should only be one installation of pip (or other package management system) managing any given working environment. More that one would lead to internal contradictions in the software. Randall is confused as to how this other one relates to the rest of the development environments. |
;~/python/ | ;~/python/ | ||
:Might be another virtualenv, or, given the absurdity of the rest of the comic, even a manually compiled python installation (many online guides instruct users to extract sources into the home (~) directory). | :Might be another virtualenv, or, given the absurdity of the rest of the comic, even a manually compiled python installation (many online guides instruct users to extract sources into the home (~) directory). | ||
Line 83: | Line 82: | ||
:[Caption below the panel:] | :[Caption below the panel:] | ||
:My Python environment has become so degraded that my laptop has been declared a superfund site. | :My Python environment has become so degraded that my laptop has been declared a superfund site. | ||
− | |||
− | |||
− | |||
− | |||
{{comic discussion}} | {{comic discussion}} |