473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Path python versions and Macosx

Hi everyone,
I use python on macosx with textmate as editor (great program).

I also use macport to install unix programs from the command line and
I find it great too.
Well I would like to have all my modules in the path when I'm using
textmate AND when I use the commandline (ipython), but because
textmate and the command line use different python versions they also
search in different places..

I found somewhere to write .pythonrc.py like this

#!/usr/bin/env python
import sys
PATH='/opt/local/lib/python2.4/site-packages/'
sys.path.append(PATH)
del sys

But it doesn't work either, I also tried to append this
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/
local/lib/python2.4/site-packages:${PATH}
to .bash_profile but nothing.

Where should I set this variables??

Thanks a lot

May 11 '07 #1
4 1724
On May 11, 1:36 pm, andrea <kerny...@gmail.comwrote:
Hi everyone,
I use python on macosx with textmate as editor (great program).

I also use macport to install unix programs from the command line and
I find it great too.
Well I would like to have all my modules in the path when I'm using
textmate AND when I use the commandline (ipython), but because
textmate and the command line use different python versions they also
search in different places..

I found somewhere to write .pythonrc.py like this

#!/usr/bin/env python
import sys
PATH='/opt/local/lib/python2.4/site-packages/'
sys.path.append(PATH)
del sys

But it doesn't work either, I also tried to append this
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/
local/lib/python2.4/site-packages:${PATH}
to .bash_profile but nothing.

Where should I set this variables??

Thanks a lot
You can set environment variables for gui apps with this freeware:
http://www.versiontracker.com/dyn/moreinfo/macosx/15073

You can edit some text files as well, but this thing just makes it
much easier.

~Sean

May 11 '07 #2
On 12 Mag, 01:09, half.ital...@gmail.com wrote:
On May 11, 1:36 pm, andrea <kerny...@gmail.comwrote:
Hi everyone,
I use python on macosx with textmate as editor (great program).
I also use macport to install unix programs from the command line and
I find it great too.
Well I would like to have all my modules in the path when I'm using
textmate AND when I use the commandline (ipython), but because
textmate and the command line use different python versions they also
search in different places..
I found somewhere to write .pythonrc.py like this
#!/usr/bin/env python
import sys
PATH='/opt/local/lib/python2.4/site-packages/'
sys.path.append(PATH)
del sys
But it doesn't work either, I also tried to append this
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/
local/lib/python2.4/site-packages:${PATH}
to .bash_profile but nothing.
Where should I set this variables??
Thanks a lot

You can set environment variables for gui apps with this freeware:http://www.versiontracker.com/dyn/moreinfo/macosx/15073

You can edit some text files as well, but this thing just makes it
much easier.

~Sean
Ok thanks, but why it doesn't work setting the .bash_profile?? What
should I set manually theorically?? The problem is also that I have
many modules for python 2.4 and trying to import them from the 2.5 of
course gives errors..
I installed them with macports (compiling), how can I make them switch
to 2.5???
thanks

May 14 '07 #3
On May 14, 4:46 am, andrea <kerny...@gmail.comwrote:
On 12 Mag, 01:09, half.ital...@gmail.com wrote:
On May 11, 1:36 pm, andrea <kerny...@gmail.comwrote:
Hi everyone,
I use python on macosx with textmate as editor (great program).
I also use macport to install unix programs from the command line and
I find it great too.
Well I would like to have all my modules in the path when I'm using
textmate AND when I use the commandline (ipython), but because
textmate and the command line use different python versions they also
search in different places..
I found somewhere to write .pythonrc.py like this
#!/usr/bin/env python
import sys
PATH='/opt/local/lib/python2.4/site-packages/'
sys.path.append(PATH)
del sys
But it doesn't work either, I also tried to append this
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/
local/lib/python2.4/site-packages:${PATH}
to .bash_profile but nothing.
Where should I set this variables??
Thanks a lot
You can set environment variables for gui apps with this freeware:http://www.versiontracker.com/dyn/moreinfo/macosx/15073
You can edit some text files as well, but this thing just makes it
much easier.
~Sean

Ok thanks, but why it doesn't work setting the .bash_profile?? What
should I set manually theorically?? The problem is also that I have
many modules for python 2.4 and trying to import them from the 2.5 of
course gives errors..
I installed them with macports (compiling), how can I make them switch
to 2.5???
thanks
Gui applications are not launched through the bash shell.
The .bash_profile never gets read.

You can accomplish the same thing as the freewware app I mentioned by
editing the xml file at ~/.MacOSX/environment.plist. Its a simple xml
file with keys and their corresponding values.

Not sure about the modules. You can force a script to look for libs
in a given directory like you mentioned, but that needs to go at the
top of each python file instead of a .pythonrc file. Maybe the
modules will work with 2.5, maybe not.

~Sean

May 14 '07 #4
On 14 Mag, 23:00, half.ital...@gmail.com wrote:
On May 14, 4:46 am, andrea <kerny...@gmail.comwrote:
On 12 Mag, 01:09, half.ital...@gmail.com wrote:
On May 11, 1:36 pm, andrea <kerny...@gmail.comwrote:
Hi everyone,
I use python on macosx with textmate as editor (great program).
I also use macport to install unix programs from the command line and
I find it great too.
Well I would like to have all my modules in the path when I'm using
textmate AND when I use the commandline (ipython), but because
textmate and the command line use different python versions they also
search in different places..
I found somewhere to write .pythonrc.py like this
#!/usr/bin/env python
import sys
PATH='/opt/local/lib/python2.4/site-packages/'
sys.path.append(PATH)
del sys
But it doesn't work either, I also tried to append this
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/
local/lib/python2.4/site-packages:${PATH}
to .bash_profile but nothing.
Where should I set this variables??
Thanks a lot
You can set environment variables for gui apps with this freeware:http://www.versiontracker.com/dyn/moreinfo/macosx/15073
You can edit some text files as well, but this thing just makes it
much easier.
~Sean
Ok thanks, but why it doesn't work setting the .bash_profile?? What
should I set manually theorically?? The problem is also that I have
many modules for python 2.4 and trying to import them from the 2.5 of
course gives errors..
I installed them with macports (compiling), how can I make them switch
to 2.5???
thanks

Gui applications are not launched through the bash shell.
The .bash_profile never gets read.

You can accomplish the same thing as the freewware app I mentioned by
editing the xml file at ~/.MacOSX/environment.plist. Its a simple xml
file with keys and their corresponding values.

Not sure about the modules. You can force a script to look for libs
in a given directory like you mentioned, but that needs to go at the
top of each python file instead of a .pythonrc file. Maybe the
modules will work with 2.5, maybe not.

~Sean
If I put it on the top of every file it works, it just need to be of
the same version...
The problem is that I would like it to run everywhere, putting a
specific path is not good idea imho (I could use try except but it's
annoying).

May 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: martino | last post by:
Hi, I am trying to install NumPy (v23.8) onder Macosx (panther version). Python (v2.3) is bundled into panther and I installed the IDE on top of that. After having untarred the source distribution...
0
by: Neil Benn | last post by:
Hello, I'm attempting to determine what paths I would need on a win32, Linux, OSX box to run python. This should be a vanilla python with no extra packages (including tk). The paths I have...
1
by: Steve | last post by:
Darwin steve.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc MacOSX 10.4.3 mysql Ver 14.7 Distrib 4.1.14, for...
14
by: Kenneth McDonald | last post by:
At the moment I'm doing most of my stuff on a Mac, but I've been considering also getting a Windows laptop. One of the reasons is that I've found it very difficult to get certain Python related...
3
by: =?UTF-8?Q?Ahmad_=E3=8B=A1_Baitalmal?= | last post by:
Hi, I'm having a hard time getting python-mcrypt extension to build. I installed libmcrypt with --prefix=/usr and I checked that the library exists -rwxr-xr-x 1 root wheel 352K Sep 19...
0
by: Jacob Davis | last post by:
On Apr 3, 2008, at 10:54 AM, Trent Mick wrote: Thanks, that seems to have worked. I added "/usr/local/bin" to the PATH in the preferences Environment panel in Komodo. Then in preferences I...
1
by: M.-A. Lemburg | last post by:
On 2008-07-25 08:13, python@bdurham.com wrote: Yes. But then Intel Itanium is being phased out anyway and the AMD64 build works on both Intel and AMD processors. True.
7
by: greg | last post by:
Thomas Philips wrote: Have a look in /Library/Frameworks/Python.framework/Versions/2.5 You can't -- this feature only exists in the Search window, which is a different kind of window...
1
by: cnivas | last post by:
Hi, I'm doing a small project on Python using MySQL as Database in MAC OS X. I was unable to connect the database. I was downloaded MySQLdb from sourceforge.net and I also modified setup_posix.py....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.