473,756 Members | 4,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: How can I customize builtin module search path to prefix/lib toprefix/lib64?

On Sep 25, 10:41*am, js <ebgs...@gmail. comwrote:
Hi list,

Is it possible to change module search path (PYTHONPATH) built-in to
Python interpreter?
I thought I can change it with configure --libdir but it didn't work for me.
I also tried patching around python source tree replacing lib to lib64
but it didn't work either.

Adjusting sys.path directly or using environ should do the trick but
I'd rather want to make it the default path for my python

Thanks,
Why not just add a custom path file (*.pth)? EasyInstall, wx, PyWin32
and others do it. Of course there's always sys.path.append as well.

Mike
Sep 25 '08 #1
2 1744
js
For 64bit python, there's no need to look at lib/lib-dynload because
libraries for 64bit should be in
lib64/lib-dynload. Having module search path which point to libraries
the python can not understand
is, IMHO, wrong.

On Fri, Sep 26, 2008 at 3:03 AM, Mike Driscoll <ky******@gmail .comwrote:
On Sep 25, 10:41 am, js <ebgs...@gmail. comwrote:
>Hi list,

Is it possible to change module search path (PYTHONPATH) built-in to
Python interpreter?
I thought I can change it with configure --libdir but it didn't work for me.
I also tried patching around python source tree replacing lib to lib64
but it didn't work either.

Adjusting sys.path directly or using environ should do the trick but
I'd rather want to make it the default path for my python

Thanks,

Why not just add a custom path file (*.pth)? EasyInstall, wx, PyWin32
and others do it. Of course there's always sys.path.append as well.

Mike
--
http://mail.python.org/mailman/listinfo/python-list
Sep 25 '08 #2
js
In addition to that, .pth cannot prepend search path.
All thing it can do is appending to it.
In my case, I have to put lib64 before lib/.

On 9/26/08, js <eb*****@gmail. comwrote:
For 64bit python, there's no need to look at lib/lib-dynload because
libraries for 64bit should be in
lib64/lib-dynload. Having module search path which point to libraries
the python can not understand
is, IMHO, wrong.

On Fri, Sep 26, 2008 at 3:03 AM, Mike Driscoll <ky******@gmail .comwrote:
>On Sep 25, 10:41 am, js <ebgs...@gmail. comwrote:
>>Hi list,

Is it possible to change module search path (PYTHONPATH) built-in to
Python interpreter?
I thought I can change it with configure --libdir but it didn't work for
me.
I also tried patching around python source tree replacing lib to lib64
but it didn't work either.

Adjusting sys.path directly or using environ should do the trick but
I'd rather want to make it the default path for my python

Thanks,

Why not just add a custom path file (*.pth)? EasyInstall, wx, PyWin32
and others do it. Of course there's always sys.path.append as well.

Mike
--
http://mail.python.org/mailman/listinfo/python-list
Oct 1 '08 #3

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

Similar topics

70
4107
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the Python standard library, and Reinhold Birkenfeld started a discussion on it in python-dev <http://mail.python.org/pipermail/python-dev/2005-June/054438.html>. The upshot of the discussion was that many python-dev'ers wanted path added to the...
0
1672
by: nejucomo | last post by:
Hi folks, Quick Synopsis: A test script demonstrates a memory leak when I use pythonic extensions of my builtin types, but if I use the builtin types themselves there is no memory leak. If you are interested in how builtin/pure-python inheritance interacts
12
1974
by: Tekkaman | last post by:
I'm getting a strange behaviour from the "pathname" and "lineno" formatter mapping keys. Instead of my file and my line number I get: /usr/lib/python2.4/logging/__init__.py as the file, and 1072 as the line number. I set up my config as follows: logBaseConf = { 'level' : logging.DEBUG,
3
1339
by: Russ | last post by:
When I run setup.py to install a pure python package, is it supposed to automatically set my search path to find the installed modules? Or am I supposed to set my PYTHONPATH variable myself in my .bashrc file? And what if I don't have root priviledge? Then what is supposed to happen? Can anyone give me a clue? Thanks.
8
4708
by: Joshua J. Kugler | last post by:
So, I have: ModTest __init__.py AModule.py BModule.py CModule.py All works fine. However, when I import ModTest, I would like it to discover and store the names of the modules beneath it, and construct a list, say
40
3485
by: rjcarr | last post by:
Sorry if this is a completely newbie question ... I was trying to get information about the logging.handlers module, so I imported logging, and tried dir(logging.handlers), but got: AttributeError: 'module' object has no attribute 'handlers' The only experience I have in modules is os and os.path ... if I do the same thing, simply import os and then type dir(os.path), it displays the contents as expected.
5
1526
by: koara | last post by:
Hello, is there a way to access a module that is hidden because another module (of the same name) is found first? More specifically, i have my own logging.py module, and inside this module, depending on how initialization goes, i may want to do 'from logging import *' from the built-in logging. I hope my description was clear, cheers. I am using python2.4.
8
1564
by: tow | last post by:
I have a python script (part of a django application, if it makes any difference) which is exhibiting the following behaviour: import my_module # succeeds imp.find_module("my_module") # fails, raising ImportError which is completely baffling me. According to sys.path, both should fail; the directory containing my_module is not in sys.path (though the my_module directory itself is). More puzzlingly, printing out my_module.__file__...
0
935
by: js | last post by:
Hi list, Is it possible to change module search path (PYTHONPATH) built-in to Python interpreter? I thought I can change it with configure --libdir but it didn't work for me. I also tried patching around python source tree replacing lib to lib64 but it didn't work either. Adjusting sys.path directly or using environ should do the trick but I'd rather want to make it the default path for my python
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9846
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.