Live data from Hacker News

My Python Development Environment, 2018 Edition

jacobian.org

191–200 of 224 posts

Re: My Python Development Environment, 2018 Edition

#191
post #9

Earlier quoted context omitted.

pipenv combine pip and venv. It's not just about activating. If you install, it will create the virtualenv if it's missing. It also, like pew, opens the virtualenv in a new shell instead of activating the current shell. A much saner approach. The UI is also more user friendly: one entry point for everything, pretty colors and icons, auto-correct of package name, and so on. Using Pipfiles, instead of requirements, are…

Does it install and manages different python versions? Pyenv does

If you have pyenv installed it can use it to install the correct python version defined in the Pipfile.

Re: My Python Development Environment, 2018 Edition

#192
post #186
post #27

I’m using Anaconda because it was recommended in a step by step tutorial for playing with deep learning. What would be involved in removing it from my system and moving instead to this set of tools? Not necessarily looking for s step by step answer, just for general suggestions. My guess is: find out which python the deep learning tools are using, remove Anaconda, and reinstall the python version needed, using the to…

Thanks for the replies everybody. One thing that's still confusing to Python tourists (my word for myself since I am usually programming in a different language, but come to Python occasionally to do something) is that everyone talks about pip, when actually it seems pip3 is required to install when using Python 3. Is this no longer the case? Or do people just say "pip" when they mean "pip3"? Or are people actually s…

Any of those could be the case. Guess it's understood that you will put a 2 or 3 on the end of the pip when you want to choose one or the other. And it goes further:

    /usr/local/bin/pip*
    /usr/local/bin/pip2*
    /usr/local/bin/pip2.7*
    /usr/local/bin/pip3*
    /usr/local/bin/pip3.5*
    /usr/local/bin/pip3.6*

Re: My Python Development Environment, 2018 Edition

#193

I haven't had to write python in awhile but are there reasons to use virtualenv etc. instead of a docker container?

Docker is SLOW to build the image. Virtualenv is great for development.

Why are you building the image so much? Just mount a pre-built image

Re: My Python Development Environment, 2018 Edition

#194
post #39
post #33

Earlier quoted context omitted.

> pyenv is now deprecated and venv is recommended Isn't it `pyvenv` that is deprecated? `pyvenv` != `pyenv`

Yes, you are right. See, that's the other (#%#$^#$%#$ - excuse my Chinese) confusion. Such conflicting name pyvenv and pyenv , someone really could have picked a better name, whoever came later. Corrected in my post.

Thanks for saying this! I just spent the last 10 minutes confused by that, trying to figure out what was going on here and what I actually have installed now:

⟩ pyenv --version

zsh: correct 'pyenv' to 'pyvenv' [nyae]?

Re: My Python Development Environment, 2018 Edition

#195

It it considered best practice or advisable to run production deployments in a virtualenv? I have always considered it to be a tool for managing multiple development efforts on the same machine, not as production environment management.

Many prefer it, though it may be considered redundant in a container.

Re: My Python Development Environment, 2018 Edition

#196

Earlier quoted context omitted.

So you're using Docker instead of virtual environments? I feel there is much more overhead with Docker, but I could be wrong. Maybe I need to try it out again!

No, it's pretty much the same as you remember it. Using docker instead of just a normal virtualenv is overkill.

And virtualenv can be overkill unless you've got multiple clients or legacy commitments.

Re: My Python Development Environment, 2018 Edition

#197

I have added PyInstaller ( http://www.pyinstaller.org/ ) to my toolchain recently for working with Python app distribution. It gets me pretty close to the Golang single distributable executable ideal... the main issue is needing to build on each target OS, which kind of sucks but I can deal with.

Yes, I am also using PyInstaller for an infrastructure automation CLI project I am doing. Works really well to produce the single executable. Also for most of the automation work, you don't really need Go's speed. Python's convenience makes iterating a lot quicker.

Re: My Python Development Environment, 2018 Edition

#198

Earlier quoted context omitted.

Anaconda does most of the stuff mentioned, and also makes it much easier to install packages based on C/C++ libraries (which most deep learning things are). So you're better off staying with anaconda. It's widely used in commercial data science projects so the idea that noone "takes it seriously" as someone else suggests is a bit silly. I assume they're thinking about a different context to data science projects. Tha…

Anaconda was the competition pip needed to become good. When Anaconda was introduced, I (a pip person), was impressed. However, at work we had pip workflows that were working okayish, so I never made the switch. Today, pip et. al. has so dramatically improved, that I hardly see a reason to use anaconda. I am not using deep learning stuff, so I cannot comment on this, but for most scientific python stuff (scikit learn…

Nothing ironic.

Anaconda integrates pip, it doesn't not compete with it.

I find that Anaconda is the best among the virtual python envs I tried; It does as good or better job of separation and tracking installations as any, AND falls back to pip (with complete integration and tracking) when a package is not in the conda repos.

pip inside conda works better than pip outside in my opinion. I don't understand the general sentiment towards (ana)conda.

Re: My Python Development Environment, 2018 Edition

#199
post #174

Earlier quoted context omitted.

> Anaconda is the easiest tool too install all dependencies. For hobbyist stuff that’s fine, and I applaud lowering the entry barrier. My issue would be if I needed Anaconda to deploy the project/dependencies into “prod” in some professional capacity, instead of standard Python build tools. Having said that, I’m not terribly familiar with Anaconda, and it seems to leverage virtualenv under the hood, possibly with pre…

Anaconda does not leverage virtualenv under the hood. Anaconda does not use wheels as part of that. However, you can use pip and virtualenvs within Anaconda, but you'll probably get some inconsistent results. The reason that Anaconda exists is to make it easier for people to have consistency between their dev environment, the build environment, and the prod environment. If you're seriously going to build all of the s…

> you can use pip and virtualenvs within Anaconda, but you'll probably get some inconsistent results.

I've never tried virtualenvs inside anaconda (what would the use case be? anaconda already provides a virtual environment)

pip is perfectly integrated within anaconda, in my experience; What inconsistencies are you talking about?

Re: My Python Development Environment, 2018 Edition

#200

Earlier quoted context omitted.

What is the issue with PyQt5?

PyQT5 is actually packaged, and I was just being lazy in my comment. It's actually pyqtchart and qscintilla that are the problems. They're not packaged for nix and won't install in a virtualenv with pip. Something to do with hardcoded paths for dependencies I think. I'm going to have a go at writing a nix files that build them from source, with the help of a NixOS expert, so we'll see how that goes.

In the nixpkgs repository, sometimes you see certain packages requiring either patches to their source code or sed changes to config files because their build system was hardcoding paths that they shouldn't.
Post reply on HN