472,988 Members | 3,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

conflict between multiple installs of python (linux)

You learn something new every day:

On my ubuntu, update-manager is supposed to use the python2.5
installed on /usr/bin. Well, I had subsequently installed a whole
bunch of stuff in /usr/local (/usr/local/bin/python and /usr/local/lib/
python2.5 etc), which I have happily been using for development for a
year. I had thought that the two pythons were completely independent.

Well, I was wrong. When /usr/bin/python2.5 runs, *by default*, it
adds /usr/local/lib/python2.5 to its sys path - and apparently there
are things in /usr/local which are inconsistent with those at /usr
(not suprising).

I have fixed the problem - but I had to modify the actual update-
manager .py file itself. At the beginning, I set the sys.path in
python *explicitly* to not include the /usr/local stuff.

But this is clearly a kludge. My question: how do I keep the Ubuntu
python stuff at /usr/bin/python2.5 from adding /usr/local/lib/
python2.5 to the import search path in a clean and global way? I
really want both pythons completely isolated from one another!

Thankyou.
Jul 5 '08 #1
3 2271
On Jul 5, 11:09*am, david <dgel...@gmail.comwrote:
You learn something new every day:

On my ubuntu, update-manager is supposed to use the python2.5
installed on /usr/bin. Well, I had subsequently installed a whole
bunch of stuff in /usr/local (/usr/local/bin/python and /usr/local/lib/
python2.5 etc), which I have happily been using for development for a
year. I had thought that the two pythons were completely independent.

Well, I was wrong. When /usr/bin/python2.5 runs, *by default*, it
adds /usr/local/lib/python2.5 to its sys path - and apparently there
are things in /usr/local which are inconsistent with those at /usr
(not suprising).

I have fixed the problem - but I had to modify the actual update-
manager .py file itself. At the beginning, I set the sys.path in
python *explicitly* to not include the /usr/local stuff.

But this is clearly a kludge. My question: how do I keep the Ubuntu
python stuff at /usr/bin/python2.5 from adding /usr/local/lib/
python2.5 to the import search path in a clean and global way? I
really want both pythons completely isolated from one another!

Thankyou.
Python's path is build by site.py. In the file /usr/lib/python2.5/
site.py, look for the line "prefixes.insert(0, '/usr/local')" and
comment it out. That should do it.

casevh
Jul 5 '08 #2
Is some problems with 2.5 i see something on internet (ex: ctypes )
So i try to install 2.5.1 for pyglet1.1, but not work with ctypes .
So ctypes lib is on the path lib's !?
But python2.6 work with ctypes.
The python2.5 and 2.6 have been installed with same command:
python setup.py install
If you see my code :

python2.5
Python 2.5.1 (r251:54863, Jul 4 2008, 14:55:17)
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/ctypes/__init__.py", line 10, in
<module>
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes
>>import pyglet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/site-packages/pyglet/__init__.py",
line 69, in <module>
_require_ctypes_version('1.0.0')
File "/usr/local/lib/python2.5/site-packages/pyglet/__init__.py",
line 64, in _require_ctypes_version
import ctypes
File "/usr/local/lib/python2.5/ctypes/__init__.py", line 10, in
<module>
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes
>>>
python (default python )
Python 2.6b1 (r26b1:64398, Jul 4 2008, 15:57:20)
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>import ctypes
import pyglet
print pyglet.version
1.1beta2
>>>

Try python 2.6
To see the path this is some code:

import sys
print sys.path
print sys.prefix
print sys.prefix

Have a nice day !

On Jul 5, 10:04 pm, casevh <cas...@gmail.comwrote:
On Jul 5, 11:09 am, david <dgel...@gmail.comwrote:
You learn something new every day:
On my ubuntu, update-manager is supposed to use the python2.5
installed on /usr/bin. Well, I had subsequently installed a whole
bunch of stuff in /usr/local (/usr/local/bin/python and /usr/local/lib/
python2.5 etc), which I have happily been using for development for a
year. I had thought that the two pythons were completely independent.
Well, I was wrong. When /usr/bin/python2.5 runs, *by default*, it
adds /usr/local/lib/python2.5 to its sys path - and apparently there
are things in /usr/local which are inconsistent with those at /usr
(not suprising).
I have fixed the problem - but I had to modify the actual update-
manager .py file itself. At the beginning, I set the sys.path in
python *explicitly* to not include the /usr/local stuff.
But this is clearly a kludge. My question: how do I keep the Ubuntu
python stuff at /usr/bin/python2.5 from adding /usr/local/lib/
python2.5 to the import search path in a clean and global way? I
really want both pythons completely isolated from one another!
Thankyou.

Python's path is build by site.py. In the file /usr/lib/python2.5/
site.py, look for the line "prefixes.insert(0, '/usr/local')" and
comment it out. That should do it.

casevh
Jul 6 '08 #3
On Jul 5, 11:09 am, david <dgel...@gmail.comwrote:
You learn something new every day:

On my ubuntu, update-manager is supposed to use the python2.5
installed on /usr/bin. Well, I had subsequently installed a whole
bunch of stuff in /usr/local (/usr/local/bin/python and /usr/local/lib/
python2.5 etc), which I have happily been using for development for a
year. I had thought that the two pythons were completely independent.

Well, I was wrong. When /usr/bin/python2.5 runs, *by default*, it
adds /usr/local/lib/python2.5 to its sys path - and apparently there
are things in /usr/local which are inconsistent with those at /usr
(not suprising).

I have fixed the problem - but I had to modify the actual update-
manager .py file itself. At the beginning, I set the sys.path in
python *explicitly* to not include the /usr/local stuff.

But this is clearly a kludge. My question: how do I keep the Ubuntu
python stuff at /usr/bin/python2.5 from adding /usr/local/lib/
python2.5 to the import search path in a clean and global way? I
really want both pythons completely isolated from one another!

Thankyou.
When you install a second version, let us say Python3.0, you want to
download the source and do the normal config and make but not make
install. Instead do a make altinstall. They will be kept separate.
I have Ubuntu's 2.5 as well as 3.0. Ubuntu installs to /usr/bin and /
usr/lib, so I installed 3.0 from /usr/local/Python-3.0 and those files
installed into /usr/local/bin and lib and the executable is
python3.0. Take a look at the README file that comes with the source
code for other options.
Jul 8 '08 #4

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

Similar topics

0
by: Adam | last post by:
Hi I had Ruby 1.6.8-8 for Windows installed on my WinXP Pro machine prior to installing Python 2.3. After installing Python 2.3, I tried to <----- screen output of python interactive command...
3
by: Tim Williams | last post by:
Hi. I'm using Python 2.3 and trying to use tkFileDialog to get a list of files. I get a message about the '-multiple' option is not a valid option in the call to Open. Python 2.3 (#1, Aug ...
3
by: Edwin Young | last post by:
Hi, I'm developing an application which is primarily in Python but has some C-coded extension modules. These modules aren't really useful to anyone other than the main application. The app works...
6
by: friedmud | last post by:
Hello all, I'm currently working on a software package that is going to be distributed in binary form (with accompanying source) for lot of different unixes (Linux, AIX, HP-UX and others). ...
9
by: Andy Leszczynski | last post by:
Hi, I run Mandrake 10.0 with python 2.3 installed by default. I want to keep it as it is but need another, very customized Python installation based of 2.3 as well. I would prefer to have it the...
2
by: vmalhotra | last post by:
Hi I am new in python scripting. I want to open a Multiple telnet session through once script. In other way i can tell i want to open two linux consoles through one script. I wrote one...
37
by: Allen Browne | last post by:
If you develop for others, you probably have multiple versions of Access installed so you can edit and create MDEs for clients in different versions. This works fine under Windows XP, even with...
0
by: =?ISO-8859-1?Q?Gerhard_H=E4ring?= | last post by:
egbert wrote: No, it's just like every other database error - the command fails but the connection is left untouched. Sure, the successful ones ;-) FWIW, this restriction is not any...
0
by: Miles | last post by:
On Mon, Sep 15, 2008 at 6:06 AM, Harish K Vishwanath <harish.shastry@gmail.comwrote: "built-in type" generally means "implemented in C", also sometimes called "extension type". Both the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.