r/learnpython • u/AlexKingstonsGigolo • Feb 12 '21
Python Seems Broken To Me As A Language/Distribution; Perhaps You Can Set Me Straight
While this is a bit of a rant, a rant often means the ranter is missing something important which nobody has bothered to make clear to them. So, I hope you will indulge me and point out where I have gone wrong.
Anaconda: As far as I can tell, someone decided to make a wrapper for
pipsimply because they thought typingpipwas somehow beneath them and preferred typingconda. This project seems to serve no other purpose than to act as a substitute forpipor, if not, the additional benefits of Anaconda appear to be negligible. What have I missed?Pyenv: How hard is it to either type the name of a python binary or create a sym. link to a particular python binary with a distinct name and then type that?
pyenvseems to be nothing more than a desire to complicate an otherwise-simple situtation.Virtual environments: If you are so scared your project might interfere with something else to the point you feel compelled to isolate the packages with a virtual environment, you have likely structured your project wrong. I have worked in software for over twenty years in C, C++, C#, python, VB.net, JavaScript, TypeScript, Haskell, etc., etc., etc. and the only time I have ever had to work with projects where someone utilized the idea of a virtual environment, or analog thereof, have been python projects. Every other language allows you to easily structure your project and isolate libraries in a way which does not involve such potential system-wide shifting of the ground from underneath the developers' feet. In my opinion, running
venvshould only print a message to standard out which reads "You have done something wrong; review your project plans."Documentation: While this problem is not unique to python, I tend to find issues in python-project documentation more than any other language; maybe this is a testament to the popularity of the language, in which case "good for you but bad for many people, like me, trying to do something". Installation is as simple as "pip install blahblahblah"; great, what if I want to uninstall or reinstall or what if something was working before and now, for no obvious reason, python is raising exceptions which make no sense? For example, suppose I receive an import error "dlopen(foo.so, 2): library not loaded: absurdlyCrypticName.dylib; referenced from foo.so; reason: image not found"; this is not helpful. I have no idea what was tried. I have no idea what the context was in which such a try was attempted. I will likely have no idea how to resolve the issue even if I can somehow discern what sort of library is involved with "absurdlyCrypticname.dylib"; yes, I could try
pip install ...and yet many times that doesn't work. Web searches often turn up nothing useful and hours, if not days, are wasted trying to figure something out with respect to an otherwise useful tool which could have been avoided if someone thought to use a reader-friendly name for the library, to give a bit more than a single line of context into a binary file, and to give some suggestions.
Maybe I am the only one who feels this way. Maybe I am too stupid to do a job I have been doing quite well for over two decades. Maybe every other developer is a psychic who sees no problem with their projects being structured poorly and who is insulted by the name "pip". Maybe it really is just me.
7
u/StandardAir Feb 12 '21
This post gives me the impression you are being told to use these tools rather than picking them up by choice?
Why do I think this? You are describing things like conda, pyenv, and even virtual envs as if they are essential for working with the language. They are not.
If you don't like Anaconda, don't use it. Although I'm personally a big fan of miniconda rather than the full distribution, but it's hardly required. Most Python users, especially outside data related domains, have likely have never touched it.
Again, not required. I use conda to manage my Python distributions, but if you find sym links satisfying, what is stopping you?
Yep, activating a virtual environment is often an extra command. Since I'm frequently shifting Python versions with conda along with my installed packages, it's no different than using nvm to manage my multiple node environments, so I don't think much of it.
This probably reflects more on the domain and tools you are working with. The quality of the official Python documentation was a big draw for me when I first began using it 10 years ago. Much of this section sounds like a reflection of a more specific frustration. I'm not familiar with Haskell or VB, but of all the other languages you mention experience with, I've had the same problems you describe. It's always made harder when you are first learning something.
If the language itself is really that much of a problem, you always have a choice, and are free to move on. There are plenty of dev jobs out there using the other languages you described. Personally, I like Python. Writing in it makes me happy. However, if it doesn't check that box for you, focus more on trying to find something that does.
6
u/dtaivp Feb 12 '21
I feel like you have to be trolling. C# has dependency management for projects (nuget references) in order to not have collisions. Same thing applies with JavaScript/Typescript. I am sure you have heard of node modules? That is literally the same thing as a virtual environment the only difference is it doesn't include the Javascript runtime because that is in the browser.
Agreeing with what other users are saying though. I have been developing with Python for like ~5 years now and I use the tools that make sense to me. I use Python3.X, pip, and venv for virtual environments. No need for conda, pyenv, etc.
5
Feb 12 '21
As far as I can tell, someone decided to make a wrapper for pip simply because they thought typing pip was somehow beneath them and preferred typing conda.
That's not what conda does. Troll somewhere else, please.
3
u/SekstiNii Feb 12 '21
I like this explanation for why anaconda exists, and would also like to point out that it can build numeric libraries against dependencies that make them faster. (i.e building numpy against intel mkl). With that said, I also dislike using Anaconda and avoid it like the plague.
I disagree that it is a structuring problem; in my opinion it has more to do with the way Python handles dependencies, and virtual environments are a fairly sane way to handle it.
Agree with this, though most of the "big" libraries do have excellent documentation. I think this is in part due to Python being dynamically typed, meaning an approach like rustdoc wouldn't work. The particular issues you mention mostly stem from C/C++ build systems being a total mess, and sometimes it leaks through.
3
u/cubic_unit Feb 12 '21
3. Here, in my estimation, the greatest value is in dealing with different versions of Python itself. Python 2.x was just officially deprecated, but different systems are likely to have different versions installed. Virtual environments make it much easier to work with this.
I target the latest version of Python in my personal projects, but some of the systems I work on don't have access to the latest release (for stability/testing reasons). So I need concurrent installations of Python in order to develop for a variety of different platforms.
Without virtual environments, this is an absolute nightmare.
Additionally, some third-party libraries require a specific version of their dependencies. If Project A needs v1.1 and Project B needs v2.0, you've got a similar mess on your hands.
Really, it's not about a personal failure to structure your project, it's about an unavoidable issue inherent to such a popular platform. I can't control my dependencies, or their dependencies, so I use virtual environments.
This functionality exists for Node.js, too, for the same reason.
Java would likely benefit from this approach, too.
Really, any non-compiled language could probably benefit, but I don't have enough experience to make such a blanket statement definitively.
-1
u/tanto_von_scumbag Feb 13 '21
Learned Docker, from someone who built a successful automated ad exchange system that got picked up by Oracle, where they now work, as a means of standardizing the running environment for software regardless of the environment presented by the hardware. They taught this in the context of AWS if you're curious. You know, because all cloud computing is is a bunch of hardware.
You just seem bitter. No wonder your post got downvoted to hell. What did you expect? If you don't like the language, don't use it. You have 20+ years of experience with others. I'm sure you can find jobs, and subreddits, involving those.
3
u/num8lock Feb 12 '21
ding ding