Live data from Hacker News

My Python Development Environment, 2018 Edition

jacobian.org

111–120 of 224 posts

Re: My Python Development Environment, 2018 Edition

#111
post #96

I don't understand this at all. It's 2018. My dev. env. for is some text editor that knows how to "jump to definition" and "find all usages" (this is sometimes referred to as "IDE"), and a bunch of Dockerfiles to build and run the tests.

Why is being 2018 relevant? Use whatever works for you. Your environment sounds hip and I'm sure you'll move onto whatever fashionable container platform and "some text editor" that is available next, but I prefer finely tuned tools that work for me.

Re: My Python Development Environment, 2018 Edition

#112
post #47
post #15

Earlier quoted context omitted.

You miss a package manager layered on top of the one already in your OS, one that's seemingly run by people with no clue what they're doing, is rife with security issues and can break your entire system as we saw today? I have no clue why a sane person would run npm.

And yet millions do?

Millions of people write their passwords down on little slips of paper next to their monitor.

Are you implying that because something is popular, it's therefore "good"?

Re: My Python Development Environment, 2018 Edition

#113
I'm a big fan of using Docker because for real world web app development, your app is often more than just getting Python and a virtualenv set up.

Earlier this week I wrote about the pains of setting up a Python development experience without Docker, and then compared it to Docker as well.

If anyone is curious, that's located at https://nickjanetakis.com/blog/setting-up-a-python-developme....

By the way, I would say Docker is anything but slow. I get near instant development feedback on my Flask applications, even when running things through Docker for Windows / WSL.

These are pretty big Flask apps too, which have thousands of lines of code, dozens of packages, tons of assets and require running Celery, Postgres, Redis, etc..

Re: My Python Development Environment, 2018 Edition

#114
I've been using a similar setup which I found online [0] when I was looking for a way to have multiple Python versions including working Jupyter notebooks etc.

It's been working great for me. Pyenv and virtualenvwrapper are really good. I'm not sure why this one needs pipsi, though. You can install CLI tools for both Python 2 and 3 using just Pyenv as demonstrated above.

[0] https://medium.com/@henriquebastos/the-definitive-guide-to-s...

Re: My Python Development Environment, 2018 Edition

#116

there are way too many python dep/env managers/things pipenv pyenv mkvirtualenv virtualenv pipsi venv pew conda virtualenvwrapper i'm sure i'm forgetting like 5. this is like https://xkcd.com/927/ for the record i use pyenv and virtualenv (although playing with ML i'm using conda)

Please realize that the concept of virtual environments in Python predate things like npm, so there are lessons that were learned later on that no one knew about. Also realize that the things you list all layer on top of each other so you're listing lower-level libraries next to higher-level ones.

E.g. pipenv I think that list could legitimately be cut down to pipenv and conda (maybe pipsi, but that's just for installing CLI tools and isn't for development). Everything else is lower-level than what most people will need for app development.

Re: My Python Development Environment, 2018 Edition

#117
post #24

>Why? pipenv handles dependency- and virtual-environment-management in a way that’s very intuitive (to me), and fits perfectly with my desired workflow. Why specifically do you use it instead of virtualenv (+virtualenvwrapper)?

I was recently explaining this here — you still end up with a virtualenv so it's not a difference in capabilities but rather ease of use: 1. It transparently creates the virtualenv for you 2. The pipfile format handles dependencies and version locking (including hashes of packages), including updates. That means that the versions won't change without your knowledge but upgrading to the latest versions of everything i…

To further elaborate on 2, it solves the problem of maintaining loose version ranges in your requirements.txt file, but keeping the versions pinned when you deploy. For example if you put `foo>=2` in your requirements.txt, this is dangerous without some way of pinning e.g. `foo==2.18.2` and running your tests against that before you deploy. But you obviously don't want to manually edit requirements.txt with minor version numbers every time you update. In the past I've maintained a separate file with loose versions and then updated packages with

  pip install -r requirements-to-freeze.txt --upgrade && pip freeze -l -r requirements-to-freeze.txt > requirements.txt
Pipenv makes this much nicer.

Re: My Python Development Environment, 2018 Edition

#118

Earlier quoted context omitted.

> ... and also makes it much easier to install packages based on C/C++ libraries I hear this often, though I cannot remember ever running into a pip package where this was an issue. Out of curiosity, could someone point me to a pip package and its conda equivalent where this is the case?

Try pip installing scipy or Numpy and you'll see the value of conda.

Although I mostly use the system's numpy package (usually shipped with the distribution), I just tried installing it via pip and had no problem (obviously just one data point).

Re: My Python Development Environment, 2018 Edition

#119

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…

> ... and also makes it much easier to install packages based on C/C++ libraries I hear this often, though I cannot remember ever running into a pip package where this was an issue. Out of curiosity, could someone point me to a pip package and its conda equivalent where this is the case?

I really like conda. It is easy to have multiple enviroments and minimizes the footprint by symbolically linking in what is needed.

Re: My Python Development Environment, 2018 Edition

#120
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…

A few years ago Anaconda helped overcome install issues with some packages, but I almost never run into those problems anymore.

One thing to be aware of is that Anaconda modifies various Jupyter configs / installs some of its own kernels. So it can be a hassle to get back to system python + plain jupyter.

https://github.com/jupyter/notebook/issues/1630

Post reply on HN