My Python Development Environment, 2018 Edition
21–30 of 224 posts
Re: My Python Development Environment, 2018 Edition
#22Earlier quoted context omitted.
As a Python developer, I just stay with pip and virtualenv, but I share the smh/wtf sentiment here. The data science folks enjoy conda but I don't see that being useful to me anywhere else. I feel like every other year someone will invent a new pip env . pyvenv (see comment section, edited) is now deprecated and venv is recommended (shipped as part of Python 3.6 installation) is another confusion. Lest not forget the…
Conda is especially useful if you want to use scientific packages on Windows.
Re: My Python Development Environment, 2018 Edition
#23Every time I use Python I miss NPM and package.json.
Re: My Python Development Environment, 2018 Edition
#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)?
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 is simply running "pipenv update" to have the virtualenv completely rebuilt (i.e. you'll never forget to add a dependency to a requirements file) and the lock file updated so the next time you push your code the same versions you tested are certain to be used.
3. It'll automatically load the .env file for every command – i.e. your project can have "DJANGO_SETTINGS_MODULE=myproject.site_settings" in that file and you will never need to spend time talking about it in the future.
4. It separates regular and developer dependencies so you don't install as much on servers
5. "pipenv check" will let you know whether any of the versions of any of the packages installed have known security vulnerabilities
6. Pipfile also includes the version of the Python interpreter so e.g. your Python 2 project will seamlessly stay on 2.7 until you upgrade even if your system default python becomes 3.
None of this is something you couldn't do before but it's just easier. Every time a Python point release happens you have to rebuild a virtualenv and now it takes 5 seconds and no thought.
Re: My Python Development Environment, 2018 Edition
#25Every time I use Python I miss NPM and package.json.
Re: My Python Development Environment, 2018 Edition
#26I haven't had to write python in awhile but are there reasons to use virtualenv etc. instead of a docker container?
Virtualenv is literally a set of shims in your $PATH and some tooling to manage those sets. Pyenv is the same thing, but extends the concept out to your actual Python interpreter and lets you rapidly switch between them.
Re: My Python Development Environment, 2018 Edition
#27What 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 tools from this post. I’ll need to read up on the tools too. Any pitfalls with this approach?
Re: My Python Development Environment, 2018 Edition
#28Is there a command needed in pipenv like the one needed in virtualenv? eg. > source env/bin/activate How does one activate one environment over another? Why is pipsi a separate thing?
Re: My Python Development Environment, 2018 Edition
#29Pyenv looks great! Sad I didn't know about this sooner, though I do have the luxury of using mostly one version of Python and have only confused it for the system Python once or twice.
Pyenv is great. On our Macs we've had zero issues installing older, specific versions of Python, every time. Highly recommended. (Getting it working properly with zsh was a bit frustrating, but that's my own fault.)
Re: My Python Development Environment, 2018 Edition
#30I just have latest Python installed and the nice support on Visual Studio. https://www.visualstudio.com/vs/python/