Great article. Is it just me or the prepend/append examples are swapped? ie. If you want to append TO your PYTHONPATH you should do PYTHONPATH=$PYTHONPATH:/some/new/path
Python Ecosystem - An Introduction
21–30 of 78 posts
Re: Python Ecosystem - An Introduction
#22> Choose Python 3 only if you need to and/or fully understand the implications. I would apply the "if you need to" part to Python 2. "3 if you can, 2 if you must"
http://wiki.python.org/moin/Python2orPython3
tl;dr "If 3 does everything you need, great. However, there's a good bit of things that still don't work with 3, in which case 2 is the safer choice. Here's a pretty long list of reasons why 2 is probably better for you. ..."
Re: Python Ecosystem - An Introduction
#23pip is a neat system and all, but I still don't see why to use that versus a system package?
Re: Python Ecosystem - An Introduction
#24I'd love to have one of these for Ruby. Every time I want to try out something written in Ruby I run head-first in to the packaging problem - Debian and Ubuntu don't appear to like shipping a working gem (presumably because it conflicts with how apt likes to do things) and the documentation on how to resolve the resulting inscrutable error messages isn't particularly easy to find. The Mac is a bit better, but I still…
Re: Python Ecosystem - An Introduction
#25I'd love to have one of these for Ruby. Every time I want to try out something written in Ruby I run head-first in to the packaging problem - Debian and Ubuntu don't appear to like shipping a working gem (presumably because it conflicts with how apt likes to do things) and the documentation on how to resolve the resulting inscrutable error messages isn't particularly easy to find. The Mac is a bit better, but I still…
The way these things get written is by keeping notes as you figure out the bits and pieces ...
The post was extracted from our internal wiki, the content in which has evolved over past 2 years and spread all over.
It took me about 20-25 hours, spread over 3 weeks, to put it in the shape of a single post/tutorial.
Re: Python Ecosystem - An Introduction
#26pip is a neat system and all, but I still don't see why to use that versus a system package?
Re: Python Ecosystem - An Introduction
#27I am indebted to HN community for the great feedback so far.
Re: Python Ecosystem - An Introduction
#28It might be matter of taste but recommendations given starting from "Understanding the packages" and to "Install packages that need compiling" are almost harmful.
My preference:
* you should not care what is your `sys.path` looks like. You need it for debugging if something goes horribly wrong. A tutorial might mention it but things like `sys.path.insert(0,..)` should be avoided or accompanied with a big disclaimer (don't use nuclear weapons if you care about the future)
* the same goes for `PYTHONPATH`. It is a hack that rarely needed
* don't use `sudo pip`. System packages should be managed by a system packager. Use `pip --user` or create a `virtualenv`
* `pip` can handle tarballs there is no need for `python setup.py install` in this case.
"Code Like a Pythonista: Idiomatic Python" is worth mentioning http://python.net/~goodger/projects/pycon/2007/idiomatic/han...
Some third-party packages that could be listed (it is subjective):
bpython - interactive prompt; something for tests e.g., pytest, tox, selenium; sphinx - docs; lxml - xml/html, werkzeug - if you talking about web-development; SQLAlchemy - sql; Cython - C extension, ~ Python syntax; async. libs e.g., gevent, Twisted.
Re: Python Ecosystem - An Introduction
#29I would only add iPython - a must for any console adventures.
Re: Python Ecosystem - An Introduction
#30> Choose Python 3 only if you need to and/or fully understand the implications. I would apply the "if you need to" part to Python 2. "3 if you can, 2 if you must"
The argument (for installing 2 as a default) is that a novice to the ecosystem will be disproportionately harmed by the inevitable Python3 experience: Novice: "I want to do X" Internet advice: "Use package Y" Novice: "Okay , wtf nothing is working" Novice: "Oh, wow, this doesn't support Python3 yet. Now I have to ignore all the internet advice and forge my own path, OR port all my code back to 2.7! This language suck…
More and more questions have problems that can be solved by Python 3, but it's probably a pain in the ass if you start with 3 then work out how to solve your problem.