Thursday, 17 October 2013

Mac OS X, Python, PySide and Matplotlib

In these days I'm working on Python application for manage some metereological datas. It uses PySide for the GUI and Matplotlib to plot some useful charts. Unluckily, I had some troubles to add this last library. After some work, I found a solution. This post is a brief guide to my little oddity on using PySide and Matplotlib on a Mac OS X environment.

Install homebrew

Follow homebrew installation instruction from its official site. Basically just type in your terminal
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Install python

It's easy with homebrew. Just type
brew install python

Set PATH

Set your Python Path. Write on your .bash_profile
export PATH=/usr/local/share/python:$PATH
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Install virtualenv

I know, probably you don't want to do 'cause you want just ONE python. I am with you, but it seems quite hard to do on Mac OS X. So, be patient!
pip install virtualenv

Create a virtualenv

I put my virtualenv in the same directory of my project. Probably it's redundant, but it's specific for this project.
cd fooproject
virtualenv py27 --distribute
A new directory called py27 will be created. It will contain all python libraries. Now, let's activate our new virtualenv
source py27/bin/activate
Your shell will become something like this:
(py27)darkstar: fooproject username$

Install PySide and PySide Tools

For some unclear reasons, pip can't install pyside: it can't find . I resolved using brew again and installing also pyside-tools to use it in with QT Designer. I did it staying in virtualenv
brew install pyside pyside-tools

Install GFortran

NumPy require GFortran. So add it with brew
brew install gfortran

Install matplotlib

Always in virtualenv, I installed matplotlib and numpy
pip install numpy matplotlib

Conclusion

Program and install your packages always from your virtualenv. When you're tired of it, just type
deactivate
And you'll exit. Good luck: I had many problems with this stuff!

Wednesday, 6 March 2013

Miguel de Icaza moves to Mac

This is a fresh news: Miguel de Icaza, founder of Gnome and Mono projects, declares in this post he moved from GNU/Linux to Mac OS X.

Wednesday, 27 February 2013

Tecnonaty

QTEN9DCZ9AD2

New Aqueduct Release


Aqueduct development continues and now it supports HTML throught a new AqueductDriver. So you can export your Fountain files as HTML+CSS files.
Try it and report bugs.
You can obtain Aqueduct at


http://www.github.com/jacopoprendin/aqueduct


Monday, 18 February 2013

Aqueduct on GitHub

If you're a writer and you like to write screenplays for theatre or movies (as me), maybe you know Fountain, a markup language realized to give you a simple, easy and elegant way to manage your scripts.

Thursday, 7 February 2013

Why I Will Not Use Java


This post is quite old. I wrote it back in 2010, when I realized Java's main drawback is its verbosity. I didn't expand my thoughts, 'cause I was too engaged at work with C, Objective-C and Python. But in these days I read some articles about Java 8 and I felt very disappointed, 'cause it lacks some features, some snippets and doesn't resolve Java's main drawbacks.

Java Language is Verbose

Java Language is verbose, in the worst way you can say it, mainly for two reasons.

Sunday, 6 January 2013

Lua vs Python or Embedding vs Extending


Another (in)famous comparison!
At least once in your programmer career, you will face the need to add a scripting language to your program. Many famous programs use a scripting language: Unreal, Quake, Emacs, Blender 3D and many games. But, when you decide it and when you start to project your implementation, you face a terrible dilemma: should you make a program with a interpreter or functions for a interpreter? This crossroad is the "embed vs extend". I'll talk about my personal opinion and how this dilemma is equal by Lua vs Python comparison.