Re: [Tutor] Help with python in MAC OS 10.6

2015-02-27 Thread Cameron Simpson

On 27Feb2015 02:16, Barbara Heliodora G. Rodrigues 
 wrote:

I'd like to ask for help with an issue I have with python. My MAC is with OS 
10-6.8, darwin kernel, 64 bits. For some reason I updated macports and it 
automatically updated python to 2.7 with a 32 bits library, and it is giving me 
lots of trouble. I can't install any new software that uses python, and 
recently I tried to use some plot (matplotlib) routines that were working fine 
before, simply didn't work, the window with the plot didn't open.Is there a way 
to force macports to install a 64bits version of python?


Since I use MacPorts and Alan doesn't I'll chip in...

First up, you're talking about the MacPorts pythn (in /opt/local) not the 
system Python (in /usr).


This page:

 
http://stackoverflow.com/questions/2111283/how-to-build-64-bit-python-on-os-x-10-6-only-64-bit-no-universal-nonsense

seems to offer useful advice on getting MacPorts to install your preferred 
variant on Python.


Next, re this:

I downloaded and installed the 3.4 and 3.1 myself, but still the computer only 
sees the version macports installed.


You need to clarify what this statement means, probably with examples of how 
you are invoking your python programs, and the output of "which python".


Your Mac should (now) have multiple Pythons installed:

 /usr/bin/python
   Supplied with MacOSX, the system Python. Probably 64-bit python. As the 
   cited web page above says, run:


 file /usr/bin/python

   to see what architecture it is. You can do that for any of the other 
   executables too to check how they were built.


 /opt/local/bin/python
   The MacPorts python (python 2 by default). It should like you need to 
   reinstall this with the right "variants" settings to get it to be 64-bit.


 Your personally built Pythons.

Regarding the last, please outline what options you used to build these. It is 
very important to build/install with a suitable --prefix Configure option to 
put them in the right place: not a specific place, but a place _not_ 
conflicting with the OSX or MacPorts pythons, for example 
/usr/local/python-2.7.7 (adjust to suit).


It is normal to add some symlinks in /usr/local/bin for "python", "python2" etc 
pointing at your preferred executables.


Next, _how_ are you installing extra packages like matplotlib etc?

I would advocate using MacPorts to install these if available; that leaves the 
arrangements in the hands of MacPorts and keeps things simple for you.


Otherwise, I would next suggest learning to use virtualenv to make a specific 
python "environment" for you work. This is easier than it sounds. The 
virtualenv command prepares a direct of your choice (eg $HOME/venv-2.7.7, to 
invent a name) which contains "python" and "pip" executables in the "bin" 
subdirectory which are crafted to automatically install and use packages 
entirely within the virtualenv directory, avoiding conflicts with other systems 
like OSX or MacPorts. This is great for experimentation of maintaining special 
setups of your own.


You can base the virtualenv of any of the installed Pythons (OSX, MacPorts, 
whatever), to get the installed libraries for free.


Please respond with further information and we can proceed from there.

Cheers,
Cameron Simpson 

To have no errors
Would be life without meaning
No struggle, no joy
- Haiku Error Messages 
http://www.salonmagazine.com/21st/chal/1998/02/10chal2.html
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help with python in MAC OS 10.6

2015-02-27 Thread Alan Gauld

On 27/02/15 02:16, Barbara Heliodora G. Rodrigues wrote:

Dear tutor,
I'd like to ask for help with an issue I have with python. My MAC is with OS 
10-6.8,


I'm not a MacOs expert but I know MacOS uses Python in some of its tools 
so do not mess with the standard version, you might break something.



I can't install any new software that uses python,


What the OS uses as Python should not necessarily impact what you use as 
Python. Usually its just a case of changing a link or creating an alias 
or environment variable.


At the worst case you can edit the shebang line of your scripts.


I tried to use some plot (matplotlib) routines that were working fine before,


How are you running these scripts? Do you just double click an icon or 
do you use a commandline? If the latter what do you type?

If the former somebody with a modern Mac will need to advise.


Is there a way to force macports to install a 64bits version of python?


Probably, but I don't know macports.


I downloaded and installed the 3.4 and 3.1 myself, but still the

> computer only sees the version macports installed.

Have you tried calling python3 instead of just python?
That should find your Python 3.X version.


HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Help with python in MAC OS 10.6

2015-02-26 Thread Barbara Heliodora G. Rodrigues
Dear tutor,
I'd like to ask for help with an issue I have with python. My MAC is with OS 
10-6.8, darwin kernel, 64 bits. For some reason I updated macports and it 
automatically updated python to 2.7 with a 32 bits library, and it is giving me 
lots of trouble. I can't install any new software that uses python, and 
recently I tried to use some plot (matplotlib) routines that were working fine 
before, simply didn't work, the window with the plot didn't open.Is there a way 
to force macports to install a 64bits version of python?I downloaded and 
installed the 3.4 and 3.1 myself, but still the computer only sees the version 
macports installed.Thank you!Regards,
Bárbara
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor