updating numpy to Python.

Those who are using Python know that using numpy is extremely useful in handling mathematical objects in Python. However, this package does not come with Python, and should be installed separately. I am using Paython 2.6, and I had this problem.

So, I tried to install numpy using macports using the following syntax: sudo port install py26-numpy

However, the first error message appeared complaining that my xcode is old and does not support this and I need to update my xcode. Apparently, it is not possible to update xcode and one has to re-install the new xcode. Since I am using old Mac OS (Snow Leopard, i.e, 10.6.x), I had to find the latest xcode for my OS system, which is xcode 3.2.6. This xcode could be found on apple developer webpage (you need to sign in with you apple ID). Xcode is pretty large file (~1.6 GB) which for me took almost 1.5 hrs. After that, I installed new xcode which itself took 40 minutes hoping that new xcode would solve the problem.

After installing new xcode, I ran the same syntax, sudo port install py26-numpy , but this time I faced another problem. An error message appeared saying that:

Error: The following dependencies were not installed: ncurses
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python26 failed

After a little search I find out that I need to update my Macport manually. So I used the following syntax to update my macport: sudo port upgrade outdated

However, this did not solve the problem completely and it seems first I need to uninstall ncursesw using sudo port -f uninstall ncursesw  , and then run sudo port upgrade outdated

Again, problem was not solved yet, it seems my perl5.2 had to uninstalled manually as well. The rest of stuff is clearly mentioned here: http://mac-os-forge.2317878.n4.nabble.com/Error-installing-ncurses-td192012.html

Sometimes new version of Python is in conflict with some of program which talk to Python, such as Inkscape. In that case, one need to set the computer to use old version of python as following:

sudo port select –set python python26

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s