473,321 Members | 1,877 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,321 software developers and data experts.

modules path

Hi there,

I moved a few modules into the modules folder (on OSX: /opt/local/lib/
python2.5/site-packages/).
They don't show up though when I start IDLE...

Is there a way to reload the modules folders in sys.path without
logging out and back in?

something like "source .cshrc" in a shell...
thanks in advance,

Arno
Sep 6 '08 #1
4 1951
On Sep 7, 8:03*am, Python <pyt...@rgbaz.euwrote:
Hi there,

I moved a few modules into the modules folder (on OSX: /opt/local/lib/
python2.5/site-packages/).
They don't show up though when I start IDLE...

Is there a way to reload the modules folders in sys.path without *
logging out and back in?
I know nothing about OS X, but no "reload" step should be necessary.
Each Python process, whether run from IDLE or some other tool or from
the shell, will form its own idea of sys.path.

So: What modules? What type of file (.py, .pyc, .egg, .zip, .so) are
you talking about? Did their documentation say that moving the files
into site-packages was all the installation that was needed? What does
"don't show up when I start IDLE" mean?

When you start IDLE and do
import sys, pprint
pprint.pprint(sys.path)
do you see the site-packages directory containing the module files?

What happens when you do
import amodule # substitute correct module name here
?

Repeat the above two steps for each of
(1) running Python from the shell
(2) running Python from the shell with the -v option

HTH,
John
Sep 6 '08 #2

On 7 sep 2008, at 00:25, John Machin wrote:
On Sep 7, 8:03 am, Python <pyt...@rgbaz.euwrote:
>Hi there,

I moved a few modules into the modules folder (on OSX: /opt/local/
lib/
python2.5/site-packages/).
They don't show up though when I start IDLE...

Is there a way to reload the modules folders in sys.path without
logging out and back in?

I know nothing about OS X, but no "reload" step should be necessary.
Each Python process, whether run from IDLE or some other tool or from
the shell, will form its own idea of sys.path.

So: What modules? What type of file (.py, .pyc, .egg, .zip, .so) are
you talking about? Did their documentation say that moving the files
into site-packages was all the installation that was needed? What does
"don't show up when I start IDLE" mean?

When you start IDLE and do
import sys, pprint
pprint.pprint(sys.path)
do you see the site-packages directory containing the module files?

What happens when you do
import amodule # substitute correct module name here
?

Repeat the above two steps for each of
(1) running Python from the shell
(2) running Python from the shell with the -v option

HTH,
John
--
I installed pyGTK from MacPorts
for some reason Macports installs these modules in the /opt/ folder
even in an old python folder: python 2.4, while my current version is
2.5
both are not in sys.path...

i appended the path and IDLE found them
I should have thought a bit more before asking...
saturday night... why am I here anyway ;)

now one question came up, how do I make those path permanent?
i mean, sys.path.append(<path)adds it for the current session,
yet when i logout of IDLE and start it again it's gone...
how do i keep it in there?

thanks for the answer John...

Arno

Sep 6 '08 #3
En Sat, 06 Sep 2008 20:26:24 -0300, Python <py****@rgbaz.euescribió:
now one question came up, how do I make those path permanent?
i mean, sys.path.append(<path)adds it for the current session,
yet when i logout of IDLE and start it again it's gone...
how do i keep it in there?
You can add that path to the PYTHONPATH environment variable, or you can put a .pth file in the current Lib directory, containing the desired path.
See http://docs.python.org/inst/search-path.html and the documentation for the site module (although it appears not to be totally accurate).

--
Gabriel Genellina

Sep 7 '08 #4

On 7 sep 2008, at 13:50, Gabriel Genellina wrote:
En Sat, 06 Sep 2008 20:26:24 -0300, Python <py****@rgbaz.euescribió:
>now one question came up, how do I make those path permanent?
i mean, sys.path.append(<path)adds it for the current session,
yet when i logout of IDLE and start it again it's gone...
how do i keep it in there?

You can add that path to the PYTHONPATH environment variable, or you
can put a .pth file in the current Lib directory, containing the
desired path.
See http://docs.python.org/inst/search-path.html and the
documentation for the site module (although it appears not to be
totally accurate).

--
Gabriel Genellina

i read that but was wondering why some modules installed by macports
did show up
in the path and some didn't
the PYTHONPATH wasn't set anywhere in my shell

I did add it and now it works!

Thanks John & Gabriel!

gr
Arno
Sep 7 '08 #5

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

Similar topics

2
by: Robin Becker | last post by:
We had some legacy applications that used import to get parts of documents in. When run separately these worked fine, but failed when run as a single process because they both imported ch1 (after...
0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is...
15
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a "Module not found" error. This PEP aims to fix that...
2
by: Joseph Turian | last post by:
Hi, What is the safest manner to extend search path for modules, minimizing the likelihood of shooting oneself in the foot? The system (which includes scripts and their shared modules) may be...
11
by: fortepianissimo | last post by:
Say I have the following package organization in a system I'm developing: A |----B |----C |----D I have a module, say 'foo', that both package D and B require. What is the best practice in...
17
by: mohan | last post by:
Hi Guys, I've been using the following IDE, "Pythonwin - Python IDE and GUI Framework for Windows. Copyright 1994-2001 Mark Hammond " With respect to my work, I had created my own modules...
1
by: Frank | last post by:
Hi, I want to create some modules to use them in my programs. Now the problem is, how to add the path to these modules permanently to the python search path. For example: import sys...
0
by: Martin P. Hellwig | last post by:
Hello all, I had some troubles in the past how to arrange my packages and modules, because I usually don't develop my stuff in the Lib\site-packages directory I have some troubles when importing...
4
by: srinivas | last post by:
hi friends i am new to python programming. i am using Python 2.5 and IDLE as editor. i have developed some functions in python those will be calling frequently in my main method . now i want to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.