3 ms·
There's no need, if you use virtualenv (as you should) you'll get the right version. I really like that I can install command line tools and then just referenc
by takeda 10y ago
There's no need, if you use virtualenv (as you should) you'll get the right version.
I really like that I can install command line tools and then just reference: <virtual env>/bin/<tool name> and it will run it with the correct interpreter.
- CJefferson 10y agoThat's fine for me and you, but no good for just distributing a script. Then I want to be able to just say to people 'run this script', maybe explain 'chmod +x' to them at best. Every extra step is a pain, and virtual env is a major pain.
- takeda 10y agoI'm not sure what are you talking about, if you use entry_points in setup.py then it will create right entries, set proper permissions and ensure the right python is run. If you use setuptools correctly it is fairly easy to install and run packages e.g.: venv-3.5 my_env my_env/bin/pip install mypackage or if you don't want to publish it to PyPi: venv-3.5 my_env my_env/bin/pip install mypackage.whl
- CJefferson 10y agoI'm talking about ease of use for non-experts. I sometimes send people python scripts, I can just tell them to run it from the command line. I can assume any linux or Mac OS X distro will have some version of python2 installed, so I can just say "run 'python myscript.py'". If I give them your instructions, then from my computer I don't have venv-3.5, or venv. I'm sure they won't either. Standard ubuntu installs don't have virtualenv or pip either, so non-root users have pain installing any of these things.
- takeda 10y agoOk, so you're talking about simple scripts that are contained in a single file, in that case it's possible to simply write a script that works on all versions. I wrote many scripts like this (ok, not all versions but 2.6-3.6), it's really on the developer. I mean even within a single major version there are changes that are incompatible. For example 2.6 doesn't have OrderedDict, doesn't have set comprehension. 3.3 doesn't have asyncio, 3.4 doesn't have async/await, 3.5 doesn't have types annotation for variables etc. So having python2/python3 doesn't really benefit much especially that at this point everyone is moving away from 2.7. Edit: virtualenv is builtin in python since 3.4.