On Linux, you settle on a single interpreter, and makes a virtualenv for each project. Make sure to never install anything systemwide. On Windows, get used to your system being broken (oh, no problem, you already are), but it won't be because of python.
That's basically the same instructions you will have for ruby and javascript. Ruby package management is about as good as python's, while javascript is a toxic wasteland.
There are languages with better dependency management, and languages with worse ones (ok, not worse than javascript, no dependency management is still better than javascript). But python and ruby do not have much difference.
Very true but with conda and docker it's not as bad for production as it used to be. Most of the packaging issues that I run into these days are related to CUDA / C++ libraries, plain python dependencies are not really an issue.
Yes, from my perspective, at least as of 2019. Every year or two since 2010 I have to stand up a new Python project, or upgrade an existing one. I'm overdue, but packages have never not been a nightmare by comparison. The last thing I used was Pipenv, which I will praise for being a tolerable experience by the end of things, but now I hear it isn't even "the thing to use" anymore? Now it's Poetry or Conda? The problem in Python is partly an issue of the individual tools, and partly an issue of the constant churn/change in the ecosystem around them.
Ruby settled on a two-part solution, Rubygems and Bundler, over a decade ago. One is the package format, hosting server, and default distribution, the other is dependency management. In practice they are two sides of the same coin, and you don't have to give much thought to them. I hate reading reductive "It just works!" quips, but it really does apply here.
> On the Python side I think the movement has started to fix the packaging mess. It's going to take a while me thinks.
I hope you are right, but ... this is the pattern: every year or two someone decides to fix it, goes about 80% of the way to a complete solution (which is maybe 50% of the effort, of course), that becomes 'the thing to use'. But then it is abandoned because that last 20% of functionality is a lot of work, and someone else comes up with a new shiny thing, and the cycle starts again.
Better ORM and better migration? That has to be a joke, that's the weak point of the framework...
Yeah there's less magic I give you that, but also because it does much less.
Also for me the Python packages are a minus, they are usually not tested very well and it's very easy to burn yourself when migrating (good luck finding some equivalent of rspec)
> Better ORM and better migration? That has to be a joke, that's the weak point of the framework...
That was probably only true 6–10 years ago. Migrations are a solved problem in Django and I can only think of one very obscure query that I couldn't get done in the ORM and had to drop into raw SQL. Aggregations, annotations and other query expressions in general have lifted the ORM to a truly strong position
I've made a full project about 2 years ago with Django, unless things are improved since then or I'm too inexperienced with the framework it still does not compare to activerecord.
Where are my scopes? Where's the equivalent of strong_migrations? The equivalent of db_consistency? Where are delegate attributes? Concerns? Arel?
The ORM isn't bad I'll admit that but some complex features are tedious.
Last time I used Rails was like 8 years ago so I'm not up to date on the changes to their ORM but when it comes to django the ORM is pretty top notch, especially when it comes to Postgres support.
I've never used rspec but it sounds like pytest and hypothesis would do the job. In ruby there's no hope for pytorch / tensorflow / ray / numba.
Django I knew had pretty weak testing tools compared to Ruby/Rails mostly because the culture was no there. It was way harder to find a Rails App with had little to no tests. Quite a contrary in Django world.
Rails is a Web Framework. I don't understand the point about ML. Those categories are totally different. I guess it might be a tiny plus, but not very practical. Going this route one might conclude that game studios should build Websites in C++?
Because most machine learning models are still deployed behind a web server? For ranking, filtering, recommenders, visual search / nearest neighbor search, NLP, image recognition and etc python is a great first choice.
> I've never used rspec but it sounds like pytest and hypothesis would do the job
Sorry it really does not, having factorybot + rspec + rspec-mocks really is a super power when it comes in testing.
The issue is that most of the time I land on a django project, it has really poor testing whereas most of the time I land on a Rails project, it has very close to complete testing. The reason is that the tests are more tedious to write.
And this culture trickles down to your dependencies as well. Anything you install with rails is almost guaranteed to have the upmost quality of testing.
It's nowhere near as equivalent, where's the behavior testing? Where is stuff like allow_any_instance_of(...).to receive(...).and_return(...)? What about shared examples? How can you patch globally the current time? Where are partial matchers like an_object_having_attributes? What about automatic db rollbacks?
They are automatically generated from the model. It presents some warts etc, but works pretty well. It basically does require some hooks to ensure that developers don't work on the same migration at once, but not a big deal.
For some people Python is not a plus, usually for us Ruby guys. I did like Python a lot more though before I found Ruby but afterwards Python became sort of “practical” and unexciting.
We usually also want the “magic”.
I can’t argue with you about the ORM and Migrations since I haven’t used Django much. The feeling I get though comparing the two is that Django is more fixated on building business facing backends and Rails is more focused on building customer facing frontends.
Over all I would recommend figuring out if you are more of a Python/Django of Ruby/Rails type. It will tell you something about your personality.
While I love Django's backend I have found a few clients balk at its general style and non-responsive design, even for un-exciting admin tasks such as approving new objects etc.
As far as getting things done, well its probably the best admin site out there.
> Over all I would recommend figuring out if you are more of a Python/Django of Ruby/Rails type. It will tell you something about your personality.
> While I love Django's backend I have found a few clients balk at its general style and non-responsive design, even for un-exciting admin tasks such as approving new objects etc.
It is sort of sad but understandable.
That's why I usually don’t go with an admin framework like ActiveAdmin in Rails. It isn’t that hard to build some general functionality for the admin interface. And the admin interface frameworks I’ve worked with in rails where hell when you needed something special and in my experience there are always a lot of special cases.
Sure you get a less consistent interface and you can argue about how much more work you have to put in to the admin interface when compared to using a gem but you can shut up the customer request quickly and just move on with the none bikeshedding part of the work.
For sure, I'm not trying to trash Rails, it's a great framework. My background is in Computer Vision and Machine Learning, where python shines, making Django an obvious choice over Ruby and Rails.
The question I was replying to was "What does Django offer that you feel is an improvement over Rails?" and I tried to answer it.
I've worked with both Rails and Django extensively, finally I phased out Django few years ago. Can't really compare those anymore, since too much time has passed. Whats better about ORM and Migration? What so good about Django Rest Framework compared to rails-api?
You love Django, I get it. You wrote it its better than Rails in various aspects without actually having a clue about Rails. Thats neither professional nor informative.
I replied to "What does Django offer that you feel is an improvement over Rails?", the pluses and minuses that I listed are what I "feel" Django has over rails.
Again I don't mean to trash on Rails, it's a great framework and miles ahead of anything you'd find in the nodejs ecosystem.
That admin interface is why Django remains my go-to. I keep meaning to make a real project in Phoenix, but that admin interface is too good to give up.
- Python package management (a raging dumpster fire)