News for hackers. Stuff that matters.
Re:'New' Python modules of 2015 by lunchladydoris on Wednesday December 23, 2015 @08:43AM (#10783190)
Interesting list. I love Anaconda!

A few years ago I tried to set up a Mac with a scientific computing stack and it took me days to hack my way through all the various dependencies and incompatible versions. Anaconda now lets me do that in a minutes.

Re:'New' Python modules of 2015 by nashequilibrium on Wednesday December 23, 2015 @09:30AM (#10783415)
Anaconda is very underrated, I use it both on my linux and mac systems. Also check out: Simple, Clean Python Deploys with Anaconda http://blog.stuart.axelbrooke.com/deployment-with-anaconda
Re:'New' Python modules of 2015 by aw3c2 on Wednesday December 23, 2015 @02:42PM (#10785174)
I love it on Windows but I wonder why you use it on Linux. What does it do better than the alternative (native packages and pip)?
Re:'New' Python modules of 2015 by infinite8s on Wednesday December 23, 2015 @02:55PM (#10785248)
One word - isolation.

One issue with using your system's packaging system is that a lot of system utilities are written in Python which makes it harder to play around with new versions, bleeding edge libs, etc.

Re:'New' Python modules of 2015 by destroythecore on Thursday December 24, 2015 @02:20AM (#10787442)
Virtualenv is pretty good for isolation.
Re:'New' Python modules of 2015 by infinite8s on Friday December 25, 2015 @07:35AM (#10791075)
Not for binary packages, which usually end up requiring libraries installed into /user/local (and let's not get started about the mess that is Python binary deployment on Windows).
Re:'New' Python modules of 2015 by 0pt1c on Thursday December 24, 2015 @02:28PM (#10789316)
I use pyenv on my Mac https://github.com/yyuu/pyenv
Re:'New' Python modules of 2015 by nashequilibrium on Wednesday December 23, 2015 @03:17PM (#10785400)
infinite8s beat me to it, exactly what he/she said.
Re:'New' Python modules of 2015 by danso on Wednesday December 23, 2015 @09:10AM (#10783313)
Me too...I taught a python class by making everyone download Anaconda's distribution of 3.x...and everyone could do the assignments no matter what kind of computer they used. Anaconda does a little too much for me to have it be my own default install but it does quite well in on boarding beginners. I use pyenv to install maintain Anaconda on my own machine when I need to replicate student work
Re:'New' Python modules of 2015 by bmer on Wednesday December 23, 2015 @09:33AM (#10783433)
What does it do that ends up being a little too much for your use?
Re:'New' Python modules of 2015 by danso on Wednesday December 23, 2015 @09:45AM (#10783523)
It takes precedence in the path over everything...and in the last version I used (before I upgraded to OS X El Capitain and wiped out everything), things like `curl` were provided [1] ...which I completely understand for Anaconda's use case, but it caused a lot of confusing grief to me when I hadn't expected that and OpenSSL was having its rough times.

I don't know if that's the case (curl being part of the package) now, with Anaconda 3 2.4.0+? It certainly isn't so when installed via pyenv, so I'm happy with that. But there were other issues in the past build...BeautifulSoup was inexplicably broken. I mean that it simply did not correctly parse non-trivial HTML pages and yet threw no errors. The results could be replicated for all of my students but I never could isolate the issue... I installed Python 3 and the same version of BS4 from scratch and had no problems, but I can't imagine where the Anaconda build would have gotten wrong. It ended up being OK since I just switched to lxml which I now happily use over BS4 on any day, but it was frustrating to not be able to diagnose the problem (I didn't get a response in the support forums either). I'm assuming this problem has gone away in subsequent versions of Anaconda though I haven't tried since lxml is perfectly fine to me.

And finally...well, I have to admit it, but I use Python like a goddamned moron in that I still don't know how to use virutalenv/venv to do proper dev isolation. And from the brief research I did, I see that Anaconda has its own conventions, or work flow...something with the conda utility. Again, I can see why it's necessary for Anaconda's use case (people who want to do data science and not hand-tweak their environment every time they upgrade a package over pip), but it added too many layers for me at the time.

[1] https://groups.google.com/a/continuum.io/forum/#!topic/anaco...

Re:'New' Python modules of 2015 by jackmaney on Wednesday December 23, 2015 @11:09AM (#10783932)
> And finally...well, I have to admit it, but I use Python like a goddamned moron in that I still don't know how to use virutalenv/venv to do proper dev isolation.

I was the same way for quite a while, until I bumped into pyenv-virtualenv[1]. Just install that plugin, and you can do, eg,

    pyenv virtualenv 3.5.1 my-project
to get a virtual environment called `my-project` based off of Python 3.5.1 (assuming that you've installed 3.5.1 via pyenv, of course). Or, you can just do

    pyenv virtualenv my-project
to make a virtualenv called `my-project` based off of the current version of Python that you're using.

Once you do that, pyenv treats `my-project` just as another installation of Python. In fact, `my-project` will show up in the list of installed versions (`pyenv versions`), and you can switch to it:

    pyenv global my-project
(Or you can switch at the local or shell levels. Whichever.)

And voila! You have your own virtual environment that can contain its own list of libraries.

And no, I'm not a shill for the creator of pyenv, I just really like the software.

[1]: https://github.com/yyuu/pyenv-virtualenv

Re:'New' Python modules of 2015 by danso on Wednesday December 23, 2015 @02:06PM (#10784980)
Thanks for this...wrapping it up in pyenv is a lot more familiar to me. And why would you apologize for shilling for pyenv?...it's amazing :) (as is rbenv, its inspiration)
Re:'New' Python modules of 2015 by jackmaney on Wednesday December 23, 2015 @02:19PM (#10785055)
You're very welcome.

And ehhh, I've been downvoted and bitched at about evangelizing pyenv before. Just thought I'd preempt that. But yes, it's an amazing piece of software. :)

FYI, I've put together a bash function for my .bash_profile that adds an indicator to my prompt showing the current Python version/virtualenv in use[1]. That's saved me a bit of frustration when going into a directory where a local pyenv version overrides the global version.

[1]: https://github.com/jackmaney/bash-profile/blob/ddb57091aab44...

Re:'New' Python modules of 2015 by pyoung on Wednesday December 23, 2015 @04:40PM (#10785834)
A few years back I made the mistake of allowing Anaconda to prepend it's path to .bashrc without realizing it. I was a bit of a novice back then, but I had a number of existing projects in virtualenvs on my system and was rather upset when everything stopped working because my default python had changed. For those out there that would like to test out Anaconda but already have a lot of projects using their default installation, I would recommend using this installation guide to keep things separate:

http://giusedroid.blogspot.com/2015/04/dont-let-anaconda-eat...

Re:'New' Python modules of 2015 by jackmaney on Wednesday December 23, 2015 @11:00AM (#10783879)
Yep, on Windows, Anaconda is a godsend.
Re:'New' Python modules of 2015 by jackmaney on Wednesday December 23, 2015 @10:58AM (#10783869)
While there are certainly advantages to Anaconda, I've never encountered any troubles installing Pandas, NumPy, SciPy, or scikit-learn on any OS X or linux system. In my experience, getting GCC up and running is far more of a pain in the ass (and it usually isn't even that bad).

I use pyenv[1] and pyenv-virtualenv[2] to easily keep track of Python versions and virtual environments. I keep one virtual environment for each project I'm working on, and things prettymuch Just Work.

[1]: https://github.com/yyuu/pyenv

[2]: https://github.com/yyuu/pyenv-virtualenv

Re:'New' Python modules of 2015 by chestervonwinch on Wednesday December 23, 2015 @08:54AM (#10783236)
No kidding! Thankfully brew makes this more pleasant.