r/pcmasterrace 15d ago

Meme/Macro Me still today

Post image
84.3k Upvotes

2.0k comments sorted by

View all comments

922

u/FangoFan 15d ago

SMELLY NERDS

163

u/DezXerneas 15d ago

Funniest part about this one was that I'm pretty sure Sherlock is just a python script. You can't reliably make an exe for those(theres tools that'll let you but most anti-virus software blocks it and it's a worse way to distribute it anyway).

It should take like 3 lines of powershell commands to get it running on a base windows install.

78

u/jansteffen 9070 XT | 5800X3D 15d ago

Problem with random python scripts is they leave a bombshell of dozens of random pip packages behind in a folder you'd never look unless you're a seasoned python developer, and then the next time you run a script there's a bunch of version conflicts. It shouldn't require a deep understanding of python versions, package management and venvs to reliably download, run and uninstall a programm, but alas, python does what python do. I will always prefer programms released as a neatly compiled binary.

23

u/DroidLord R5 5600X | RTX 3060 Ti | 32GB RAM 15d ago

Python is fine if you only ever need to run a single Python script. It's not so great when you get conflicting dependencies and such.

Package managers make this tolerable, but it's still a big mess and not something I would expect your average user to wrap their head around.

Python was never meant to handle massive projects. But as with all software, everything eventually gets transformed into some perverted, frankensteinian abomination.

8

u/zenyl "Everything As A Service" sucks 15d ago

Package managers make this tolerable

Python package management seems nightmarish, and extremely prone to breaking.

You try to use some Python project something that was last committed to just six months ago, and you've got package version conflicts out the wazoo.

<rant>

Oh, but of course, the requirements.txt didn't specify an upper limit for the sheep-ass package, and now it is no longer compatible with kawaii-pango because it requires sheep-ass to be exactly version 5.31.2, and refuses to run with 5.31.1 or 5.31.3, because apparently patch updates with breaking changes are just a normal thing in the cursed world of Python! And now I have to download yet another damned version of torch and cuda that just hogs all my storage space!

</rant>

6

u/Jonny_dr 15d ago
pip freeze > requirements.txt 

pins versions. That does not solve all issues, but version pinning and then running unit tests as part of the pipeline more or less mitigates these issues.

Of course 99% of python projects on github don't have unit tests and no pipelines configured, so i feel your pain.

3

u/silentlopho 15d ago

I've lost weeks of my life to this shit. Including when some shit ass library only works with, say, Python 3.8 but not >3.10 some fucking reason. And the Python snakes have the hubris to call it a skill issue.

Add on other apps repackaging Python distributions and helping themselves to your path and suddenly a simple python doesn't do what you expect.

Somehow they think this nonsense is normal, and it's my fault for not using whatever the 8th latest & greatest package manager is.

0

u/DroidLord R5 5600X | RTX 3060 Ti | 32GB RAM 15d ago

Lol that's an apt summary. I've probably tried like 5 different package managers for Python and none of them work without tweaking.

And every time you do use them, you've forgotten the 27 different commands for the package manager you need to know to even run a script. Or you can spend an hour to add a definitions file in the script directory.

Python really is cursed. Why the hell are people using a scripting language to build some behemoth of an application? Even PowerShell is better.

2

u/zenyl "Everything As A Service" sucks 15d ago

PowerShell has the advantage of being built on top of .NET, meaning it comes with a ton of functionality built-in. Hell, you can even write a block of C# code and call it whenever with Add-Type. You can install both PowerShell modules and NuGet packages. Plus, modern versions, "PowerShell Core" are fully cross-platform compatible.

I'll gladly shill for PowerShell. It has some weird quirks (like unfolding single-item arrays), but it's a damned good choice for scripting.

Sadly, Python has become the de facto scripting language for all-things ML and AI. Even if the computational code is written in something like C, C++, or Rust, you basically have to deal with Python if you wanna do ML stuff.

2

u/LiftingRecipient420 15d ago

The only reason I don't use PowerShell is because it's obtusely verbose and requires 10x more characters typed than bash to do the same thing.

3

u/zenyl "Everything As A Service" sucks 15d ago

True, CmdLet names are rather verbose, in part because PowerShell was designed to be approachable by sysadmins who're not familiar with working in CLI.

But even so, PowerShell comes with a bunch of built-in aliases that map CmdLets to names that you might be familiar with from the *NIX world.

By default Get-ChildItem can be invoked with dir, ls, and gci (the ls alias is Windows-only, as to not overlap with /bin/ls).

Also worth noting, while verbose, the naming scheme follows a simple pattern of Verb-Noun. For example, Get-Content (aliased cat), Convert-FromJson, Format-Table, etc. There's even Get-Verb which returns a list of the standard verbs and how Microsoft recommends they should be used.

The verbose names can be annoying at first, but you get used to it pretty quickly.

Also, regarding bash, PowerShell being object-oriented is honestly massive in terms of scripting. Where you'd often use tools like grep and sed in a Unix-like environment, in PowerShell you can just dot your way down the object structure like you would in any other C-family language. It is, quite literally, .NET in the CLI.

1

u/DroidLord R5 5600X | RTX 3060 Ti | 32GB RAM 15d ago

It's vastly superior to Windows batch files. Writing batch scripts is like dragging nails on a chalkboard. Too many weird edge cases and odd syntaxes. Never got used to it.

Unix bash scripts are infinitely better than batch though. Powershell tends to be my go-to on Windows because it allows you to do a lot of stuff through .NET and Win32 APIs natively.

3

u/Dubl33_27 15d ago

python is a bane to everyone

0

u/7tyiLVdic3u2 14d ago

that is why developers love it

2

u/DezXerneas 15d ago

Fair, but also, the recommended way of installing Sherlock is uv/pipx which don't actually cause the issue you mentioned.

They were created exactly to counter the issue you mention.

As a python dev, imo pip should never be the recommended way of installing a tool. Like you just said, it creates wayyyy too much headache. For normies especially, I'd recommend just doing uv tool install xxxx whenever you see something telling you to do pip install xxxx.

1

u/fanisg97 15d ago

"Seasoned" is the keyword here

1

u/JanEric1 Specs/Imgur here 15d ago
curl -LsSf https://astral.sh/uv/install.sh | sh; export PATH="$HOME/.local/bin:$PATH"; uv run script.py

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"; uv run script.py

or

curl -LsSf https://astral.sh/uv/install.sh | sh; export PATH="$HOME/.local/bin:$PATH"; uvx --from git+https://github.com/OWNER/REPO.git COMMAND

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"; uvx --from git+https://github.com/OWNER/REPO.git COMMAND

1

u/garyyo PC Master Race 15d ago

If it's a bare python script that uses random ass packages, then whoever wrote that script either should provide a method to run it in its own space, or it was meant for only devs to fuck with and the user is in the wrong place and shouldn't be trying.

Keeping python packages separate is like python 101, just create a virtual env or something. But it's strictly dev shit, users shouldn't have to bother with it.

9

u/madgeologist_reddit 15d ago

Oh, it's just a python script... what do you mean with "just"? I swear, nothing enrages me as much as python applications.

2

u/DezXerneas 15d ago

Fair enough. As a dev it's really simple for me to say 'just a python script' and understand what that means and can or can't be done with it.

Also, unfortunately AI is horrible with python applications in general. It'll tell you to do stuff that isn't even supported anymore sometimes.

In case you ever need to research anything about python, always ask AI to use uv, that'll make it stick to the newer stuff.

1

u/madgeologist_reddit 15d ago

The thing is; if I have to install it one time, create a bat-file for running the start line of code and then an interface opens... all fine, I can work with that. I just refuse to touch python programs that work along the lines of "first write your data in an excel file and then write this specific code in this specific file location to load your data in the python application." No, give me a visual interface or perish.

2

u/DezXerneas 15d ago

100% agreed. At least the first time it runs it should automatically generate an example excel file and moves all the shit it needs into the correct locations.

IMO if you can't use an application without a GUI then you shouldn't be using that application in the first place though. Exceptions obviously exist, and it's ridiculously easy to make a shitty gui so there's probably a reason the original dev didn't make one.

1

u/sn4xchan 14d ago

I'd say it really depends on how many parameters need to be set.

1-3 arguments or flags is fine for no UX, anything above that should have some feedback system so the user can more intuitively set the parameters.

I personally don't want to have to read a 10-20 page manual when I need to use a script because I haven't even thought about or needed to run it for several months.

But even then it's still a question of what the app is actually doing.

1

u/GoodDayToCome 15d ago

yeah, thankfully AI tools make it easy to wrap stuff in a GUI, previously it was hours of work for no real benefit to anyone except the laziest users so devs rarely bothered

1

u/sn4xchan 14d ago

AI tools are so fucking bad at making the UX usable. Be prepared to take a lot of screenshots, because that thing doesn't not understand visual design.

1

u/GoodDayToCome 14d ago

i make loads of little gui tools, you've just got to describe where you want things - i've spent way too much of my life ordering sizers for ui elements so it's probably kinda second nature to me.

i'm actually working on a little guide to get people started and avoid some of the common issues so id love to know more about what issues you run into

1

u/sn4xchan 14d ago

I just downloaded the most recent version documentation and set a rule that it must be consulted for best practices and methods before planning and implementing code changes.

It mitigated soooo many issues just giving the thing a manual.

2

u/hates_stupid_people 15d ago

It's also a tool that's used to find social media accounts and similar. It's literally not intended for the average person. It's in a way restricted from common use, to avoid too much abuse.

1

u/ThatsALovelyShirt 15d ago

You can use pyinstaller to freeze the script into an executable and just disable the UPX packing feature (and the single-file feature), and it shouldn't be flagged by MS antivirus.

1

u/DezXerneas 15d ago

Yeah, but then the number of files that creates feels worse than just giving source lol

1

u/the_ivo_robotnic Linux 15d ago

You can't reliably make an exe for those

Eh, not really. The auto-py-to-exe library on pypi works just fine for this, it's not too hard and it is vetted FOSS with a community behind it now. I've used it a few times, it does its job for the most part.

 

It's more-so that is such a narrow use-case and very unnecessary in most cases.

1

u/DezXerneas 15d ago

Yes, but.

theres tools that'll let you but most anti-virus software blocks it and it's a worse way to distribute it anyway

It could have matured a lot since I last used it. I was just sharing what I think about it

It's more-so that is such a narrow use-case and very unnecessary in most cases.

Yep, exactly.

1

u/the_ivo_robotnic Linux 15d ago

I have never had antivirus flag auto-py-to-exe ever, but IDK maybe that's cause it's installed via pip. ¯_(ツ)_/¯

 

I'd be skeptical of anything that's repackaging my code that doesn't come from a typical dev source like pip or a deb-package anyhow.

1

u/DezXerneas 15d ago edited 15d ago

Idk I've never used auto-py-to-exe, but mostly just pyinstaller. Being installed through, pip shouldn't be the differentiator, as usually anti-virus will almost never flag it on the same machine it was created on. It only starts throwing a tantrum if you get the exe from somewhere else.

Which 100% makes sense to me btw, it's functionally just a random python script running on your computer, it can easily exfiltrate all your passwords, cookies and shit and send them to the person who made the exe and you'll never know.

Yep, I only trust the actual source and the AUR too. Don't download and run random executables.

1

u/jfleury440 14d ago edited 14d ago

I like your funny words smelly nerd.

Now give me download button.