Live data from Hacker News

Python 3.11

docs.python.org

141–150 of 156 posts

Re: Python 3.11

#141
post #102

Earlier quoted context omitted.

I don't know; I've just written something in .net/c# and it's pretty bloddy difficult to deploy.

.NET can export self-contained single-file executable that doesn't require any runtime on the target computer/server. Python has solutions like PyInstaller, but it's not built-in and requires building on the same system. In .NET, you can use the built-in tools to export binaries for Linux from Windows.

Except when you have some specific dependencies/targets that make this difficult. I'm sure I'll get there eventually, but I chose .net for this thinking it would be dead simple, and yet here I am wading through documentation and stackoverflow posts to get to my self-contained single-file executable.

Re: Python 3.11

#142

Earlier quoted context omitted.

It does install them too - however I have the pro version, and I'm not sure if that's a pro feature or not.

It installs versions of Python or versions of packages ? I can't find anything in the docs about installing versions of Python, just packages (which I've done on occasion, when I'm really confused about why my environment isn't working, I also have pro version now but I'm pretty sure I'd done it when I had community version too)

Ah, just checked. I thought it installed python versions as well, but it can create environments (virtualenv, conda, system pythons, pipenv, docker), and can install packages in those environments.

I do not see a way to install a whole new python version (only the ability to add to the list, which requires you to select the interpreter from an open file dialog)

Re: Python 3.11

#143
post #81

Earlier quoted context omitted.

Wouldn't say it better myself. Everything you gain with fast coding you lose on tackling performance issues, GIL, dependency management... Things harder to solve once you're committed to production.

It depends very much on what you are doing. Python for big complicated applications is a No for me also but python for extraction jobs in a ETL pipeline or data science tasks is a huge YES.

[deleted]

Re: Python 3.11

#144
post #86

Earlier quoted context omitted.

Can you give a specific example? I've had nothing but pain with conda in mixed linux/mac/win environment at work, and actively worked to get it deprecated. We're on plain venvs now, with the occasional setup.py Curious if I missed some useful case for it. - very slow dependency resolvers - using conda in docker is annoying - the worst thing: inconsistencies in downloading binaries and other resources between win/mac/…

Curious if I missed some useful case for it. Conda will package and version things like compilers and C libraries etc in a sane way. I can 'conda install' a package and start using it, but if i 'pip install' the same package I'm still left having to hunt down and install a bunch of additional dependencies. For example 'conda install cython' gives me a fully working and consistent cython on all platforms in a way that…

I think this is an interesting case where people just want different things, and so the thing that they want is "better".

Some people really just want Python+extras and don't want to worry about getting a fortran compiler. Conda is great for this.

Other people really don't want a big meta-install system that bundles a bunch of dependencies. Maybe they're on Linux, they target a single platform, or they want to use a package not in conda that works with a more recent version of the dependencies that conda bundles.

Re: Python 3.11

#145
post #42

Earlier quoted context omitted.

For me, pyenv on Mac is about 15 minute compile time with a bunch of environment variables required to make sure tkinter works properly.

Use miniconda. It's much better.

The licensing is not compatible with my companies legal team.

Re: Python 3.11

#146
post #60

Earlier quoted context omitted.

Care to elaborate on what is bad? How bad are they compared to other languages? (Assuming you are always accepting some tradeoffs when moving from one eco system to another)

Off the top of my head: - What you get when you import a library depends on state that's scattered all over the system: system-managed packages, pip-managed system-global packages, pip-managed per-user packages, which virtualenv is currently active, which directory you're currently in, which directory the program you're running is in, whatever it is that conda does.... - There's no concept of reproducible builds or d…

> There's only one global repository. If you want to build some libraries and reuse them the same way you'd use a normal library dependency, you have to publish them to the global PyPi. I think there might be an expensive service that works around this, but there's no repository program that you can just spin up on your own servers.

https://pypi.org/project/pypiserver/

Also, pip will install from a git repository.

Re: Python 3.11

#147

Earlier quoted context omitted.

When you say "deploy" do you mean "put it on a webserver"? I've deployed python Web services on to very limited environments that have nothing more than an interpreter. Nowadays I use pip-tools and docker which makes updating trivial. Do you perhaps mean distribution as an app? I've had luck with pyinstaller. There can be fiddly bits but overall it's pretty smooth. It's easier if you are targeting a system with an in…

Read and learn: https://sedimental.org/the_packaging_gradient.html

Thanks, I know all of that. What made you think I don't?

Re: Python 3.11

#148
post #44

Earlier quoted context omitted.

> they are (understandably) refusing to ship an up-to-date global python interpreter with macOS What is the understandable reasoning?

It's pretty common to have kept `/usr/bin/python` as Python2. This is the most conservative option and won't break anything that's already running. Anyone who is using Python currently will have already installed Python 3 (or knows how to do this), and is probably using `#!/usr/bin/env python3`. As an OS vendor with many (many...) systems in the wild, you don't want to switch Python versions on people unexpectedly. E…

Oh, sure, it's definitely not a good idea to change what the unqualified python binary refers to. But I interpreted "refusing to ship an up-to-date global python interpreter with macOS" as meaning that Python3 isn't shipped at all, with the binary name "python3").

Is that the case? If so, I still don't understand the reasoning.

Re: Python 3.11

#149
post #116

Earlier quoted context omitted.

> There's "pip freeze" but that's a one-time operation that you can't then reverse, so it's only usable for leaf applications. What do you mean by reverse? You can certainly upgrade all packages locally and then run pip freeze again if you want to set up newer versions, or like manually change versions in your requirements.txt and `pip install --upgrade` to update them. For stronger reproducibility guarantees there's…

> What do you mean by reverse? You can certainly upgrade all packages locally and then run pip freeze again if you want to set up newer versions, or like manually change versions in your requirements.txt and `pip install --upgrade` to update them. For stronger reproducibility guarantees there's also `--require-hashes`, although admittedly freeze doesn't appear to support easily writing hashes to a requirements.txt. Y…

> So in more sensible ecosystems you will have, e.g., Gemfile and Gemfile.lock. pip freeze is, effectively, the way you create Gemfile.lock, but it forces you to destroy Gemfile to do it.

No, it doesn't.

  pip freeze -r requirements.txt > requirements.lock.txt
There's plenty of legitimate criticism of python in general and pip in particular, but much of yours send to be criticism of things that are factually untrue.

Re: Python 3.11

#150
post #144
post #86

Earlier quoted context omitted.

Curious if I missed some useful case for it. Conda will package and version things like compilers and C libraries etc in a sane way. I can 'conda install' a package and start using it, but if i 'pip install' the same package I'm still left having to hunt down and install a bunch of additional dependencies. For example 'conda install cython' gives me a fully working and consistent cython on all platforms in a way that…

I think this is an interesting case where people just want different things, and so the thing that they want is "better". Some people really just want Python+extras and don't want to worry about getting a fortran compiler. Conda is great for this. Other people really don't want a big meta-install system that bundles a bunch of dependencies. Maybe they're on Linux, they target a single platform, or they want to use a…

I think this is an interesting case where people just want different things

For some people Python is really more of an end user application. They don't want to develop and distribute and deploy software, they want to write scripts and analyze and transform data. They expect the script a colleague emailed them to just work and expect their colleague to be able to open and run their Jupyter notebook as easily as they can open and run an Excel document. For those people Conda comes much closer to solving their problems.

Post reply on HN