79
votes
3answers
88k views

How do I find out my python path using python?

How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)?
8
votes
3answers
588 views

Python: sharing common code among a family of scripts

I'm writing a family of Python scripts within a project; each script is within a subdirectory of the project, like so: projectroot | |- subproject1 | | | |- script1.main.py | `- ...
3
votes
3answers
983 views

Automatically call common initialization code without creating __init__.py file

I have two directories in my project: project/ src/ scripts/ "src" contains my polished code, and "scripts" contains one-off Python scripts. I would like all the scripts to have "../src" ...
3
votes
0answers
173 views

Keeping Python packages with the same top-level name in different directories

I have several Python packages that I'd like to keep on separate filesystems but which unfortunately share the same top-level module name. To illustrate, the directory structure looks like this: ...
1
vote
0answers
25 views

Use jinja2 without install

Is it possible to use Jinja2 without installing it using easy_install or pip ? I dont have root access on my server but I would like to use Jinja2. I was wondering if I could do this: import ...
1
vote
0answers
233 views

organizing many python scripts, in a large corporate environment

We've been doing a fair amount of Python scripting, and now we have a directory with almost a hundred loosely related scripts. It's obviously time to organize this, but there's a problem. These ...
0
votes
4answers
71 views

Python: Is it possible to only have specific modules from a folder in your sys.path

There are only one or two modules which I need from the a folder which contains several other python modules. When I add the folder to my path, I effectively make all the modules in that folder ...
0
votes
1answer
154 views

html 1.13 package installation

I downloaded html 1.13 package from Python site and as per instructions I doubleclicked on install.bat and installed it. I also added the directory C:\Python26\HTML.py-0.04 to PYTHONPATH. But when I ...
0
votes
1answer
57 views

Python Path not consistent in Django- double module imports

I am having an issue in my Django project where I am importing the same module twice. This is causing a unit test of mine to fail: this unit test checks that the view found by resolving a URL is the ...