1987: Python Environment

Explain xkcd: It's 'cause you're dumb.
Revision as of 12:55, 12 July 2018 by 162.158.62.231 (talk) (Explanation)
Jump to: navigation, search
Python Environment
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.
Title text: 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

Ambox notice.png This explanation may be incomplete or incorrect: This needs the rest of the table filled in, perhaps say where each entry leads.
If you can address this issue, please edit the page! Thanks.
Ambox notice.png This explanation may be incomplete or incorrect: Hello? I added the incomplete almost a month ago after about two months of it not being complete and no one has fixed it. Please fill in the table.
If you can address this issue, please edit the page! Thanks.

A development environment is the collection of tools used to create a computer program. It generally includes an interpreter, a package manager, and various 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.

Python is a computer programming language which has been around for quite a while, especially on Linux platforms. Randall 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 hard drive's directory structure.

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 WIPP site in New Mexico, and other nuclear waste disposal sites. In particular, it may refer to 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.

Text Explanation
$PATH $PATH refers to the 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 is the Python 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 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 Apple bundles an (out of date) version of Python with OSX. This only leads to ????.
 ????
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., this question on stack exchange.
Anaconda Python Anaconda is a Python distribution for data science and machine learning related applications.
Homebrew Python (3.6) As of the creation of the comic, Python 3.6 is the current stable version of Python.
Python.org binary (2.6)
(Misc folders owned by root)
/usr/local/Cellar
/usr/local/opt Both /usr/local and /opt are directories that store files that do not belong to a Unix-like operating system. Usually, files in /usr/local were created with a make command, and files in /opt are unbundled packages. The joke is that /usr/local/opt should really, really not exist.
/(A bunch of items with "Frameworks" in them somewhere)/ The system-included Python distribution in macOS resides in /System/Library/Frameworks
$PYTHONPATH The environment variable PYTHONPATH specifies the search path for Python modules to the Python interpreter. Its presence may cause undesired modules to be considered for import.
Another pip?? There should only be one PIP (package management system) in place. More that one would lead to them contradicting each other. Randall is confused as to how the second one got there.
~/python/
~/newenv/ Probably a virtualenv. Virtualenvs are mechanisms for having Python environments that don't conflict with the system Python. They include the Python interpreter, independent library paths, and usually a copy of pip. The user typically installs packages using the virtualenv's pip such that they can only be accessed by the virtualenv's Python instances, while more common packages are still referenced via the system Python paths.
/usr/local/lib/python3.6
/usr/local/lib/python2.7

Transcript

[A single frame depicting a flowchart is shown. Many chaotic arrows are arranged between the items which are:]
$PYTHONPATH
EASY_INSTALL
ANACONDA PYTHON
HOMEBREW PYTHON (3.6)
ANOTHER PIP??
HOMEBREW PYTHON (2.7)
PYTHON.ORG BINARY (2.6)
PIP
EASY_INSTALL
$PATH
(MISC FOLDERS OWNED BY ROOT)
????
[The endpoints are:]
/usr/local/Cellar
/usr/local/opt
/(A BUNCH OF PATHS WITH "FRAMEWORKS" IN THEM SOMEWHERE)/
~/python/
~/newenv/
/usr/local/lib/python3.6
/usr/local/lib/python2.7
[Caption below the panel:]
My Python environment has become so degraded that my laptop has been declared a superfund site.


comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!

Discussion

Now you can see why the BOT is written in PERL;). But I have to be honest, there are also different versions causing similar problems... --Dgbrt (talk) 14:26, 30 April 2018 (UTC)

Is pictorial misspelled as pictoral? --162.158.62.231 19:08, 30 April 2018 (UTC)

Wiktionary says: "Probably an alteration of pictorial..." But please add new comments to the bottom. --Dgbrt (talk) 21:03, 30 April 2018 (UTC)

Currently working on a table with everything. Note: Programs are boxed, and file paths are just strings. Chbs (talk) 14:44, 30 April 2018 (UTC)

I never will understand why you guys always create tables...--Dgbrt (talk) 15:59, 30 April 2018 (UTC)
Convention? IDK. Chbs (talk) 17:06, 30 April 2018 (UTC)
Of course there is no convention, but often a floating text is a prettier layout. And it's easier for the editors because a single wrong char can corrupt the entire table. But we always get tables here... --Dgbrt (talk) 17:49, 30 April 2018 (UTC)

"using sudo to install python packages" is probably a reference to the "(Misc folders owned by root)" Chbs (talk) 17:06, 30 April 2018 (UTC)

I swear every so often Randall just releases a comic like this to mess with us... Just in case the last few ones have been too easy. Linker (talk) 14:58, 30 April 2018 (UTC)

Created by a PYTHON script (well actually PERL but that's besides the point (I know a lot of people who would fight you over that comment)) - why would people fight me over this comment? Zachweix (talk) 15:25, 30 April 2018 (UTC)

Only in the sense of "How dare you imply that python and perl are interchangeable!" Cgrimes85 (talk) 16:06, 30 April 2018 (UTC)
I've removed the "lot of people". Comments are going here. --Dgbrt (talk) 15:58, 30 April 2018 (UTC)
They aren't interchangeable, but in respect to the comment above it is besides the point Zachweix (talk) 16:22, 30 April 2018 (UTC)

Isn't the joke that installing multiple versions of Python has resulted in a Byzantine set of $path declarations, pointing all over the place? The title-text/alt-text reference to nuclear waste does not seem like the central joke, but merely compares the difficulty of cleanup. ProphetZarquon (talk) 16:25, 30 April 2018 (UTC)

May a file system which uses HashIDs for version tracking allow files stored anywhere within that file system to be accessible by only referencing their hash, without the use of paths? Seems like "folders" are not as useful as relational tags would be. ProphetZarquon (talk) 16:25, 30 April 2018 (UTC)

My has this problem. System Integrity Protection won't let me update python libraries, so whenever I need to update a library I install it in a different place and have to switch to the new version. I can't actually uninstall anything because of SIP, so multiple versions of every library I have ever used will remain on my computer forever.162.158.75.16 18:56, 30 April 2018 (UTC)

Thanks to the editor who added the article about the WIPP warning messages. I'd been looking for that source for a while. Cgrimes85 (talk) 13:27, 1 May 2018 (UTC)

Whoever added this pretty rude 2nd incomplete tag: who do you think you are and what this is!? we are volunteers, not your personal data entry monkeys. 172.68.51.46 00:07, 9 August 2018 (UTC)

Huh, seems no one mentioned the atrocious pun of storing homebrew in cellar. -Tanz

this one is sooooo confusing... reminds me of the mess my desktop is xd

edit: it includes tons of malfunctioning scripts and crappy drawings... --an user who has no account yet 172.64.238.19 (talk) 21:10, 1 September 2023 (please sign your comments with ~~~~)

/usr/local/Cellar was the default folder that Homebrew chose to install things. I think they changed it with Apple Silicon Macs but that's where it would always store everything on Intel Macs. Numbermaniac (talk) 05:22, 8 September 2023 (UTC)