Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You could just give up and resort to using Docker.


Using docker is not free, you are effectively trading one type of complexity for another.

And of course you'll have to make sure people equally have good practices, since incorrectly using sudo pip install in docker and not a venv are very common.

So again, one possible solution for a certain context, but I wouldn't sell that to most people. Certainly not to beginners.

People writing their pythonanywhere website won't pop up a container, won't they ?


For a beginner trying to run someone else's Python project, it is free. You run one command and it works. There's tons more complexity under the hood, but you don't have to deal with it. This is why so many Python projects do resort to Docker.

And btw, JS doesn't have this problem, they use NPM.


> For a beginner trying to run someone else's Python project, it is free.

Its absolutely, by far, the highest friction alternative on Windows for anyone that doesn't use Docker for other purposes.


- Not if you have to edit the code. Try to explain your beginner with notepad++ how to do that.

- Not if you have to deploy the code.

- Not if you have to import the code in your own project.

Basically, not if you want to do anything by running the code. For which I would suggest an installer instead.


I don't see what editing has to do with this. Whether you're running the main.py or the Dockerfile, if you want to edit the code then you gotta use Notepad.


Is it not just install and run? The alternative is installing Python, installing pip, etc.


Installing python with the python.org installer installs the entirety of Python and its standard library and tools, including pip, venv, etc., and the py launcher which supports selecting from multiple python versions. Linux distros may split this up into different packages, but on Windows (or Mac, afaik, though the py launcher is a Windows-only feature) using the official installers is one-stop shopping.

And, no, docker isn't just install and run on Windows. Before Docker made a heavy push for paid Docker Desktop for even personal use, it was close to that.

But now the way to get a free usable docker command line is to install WSL and a Linux environment, install docker there, and then invoke docker via wsl. (Which, of course, you will not find via Docker’s own information, which will try to sell you a paid subscription.)


I tried it just now on my spare Win10 desktop, and it went like this:

1. Download and install Docker desktop for Windows

2. Restart Windows (guess you don't have to do this with just Python)

3. Run Docker Desktop

4. Say "no" to signing into a Docker account

5. Wait for engine to start, which took a few minutes the first time, a bit annoying

6. Pull and run an image (I tried nginx)

It was weird being asked to log in, but the "no" button was pretty clear. I didn't feel like I was forced to use WSL to avoid paying; maybe they've backtracked from something. Unity was far more convincing that I had to pay.


Even at that, there are edge cases like when a python package like Tensorflow uses a instruction set that is not available on a Arm machine.


Yeah, personally I wouldn't develop on a different ISA than what I deployed to in production.


Honestly this. I've moved three companies now to docker based dev for teams on python. It's better for teams who want to customize how they in particular work without inadvertently also blocking themselves from quickly contributing to another team because that team uses a totally different python management scheme. So a team can be conda-in-docker and another team can be virtualenv-in-docker and another team can be raw-python-in-docker and that one group of weirdos can be jython or whatever other sad shit they cook up.

The common interface is they all use `docker-compose up` and have their editors hooked into the containers.


this is the way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: