pythonpath

easy way of installing python apps without using PYTHON path or muli symlink in site-package

Hi, I didn't want to install python modules using easy install, symlinks in site-packages or PYTHONPATH. So, I am trying something that I do wants system wide, then any application installation is done locally. Note, the root password is required only once here. First create a symblink of.../pythonX.Y/site-packages/mymodules -> /home/...

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)? ...

Is the first entry in sys.path supposed to represent the current working directory?

I had always assumed that the first entry in sys.path by default was the current working directory. But as it turns out, on my system the first entry is the path on which the script resides. So if I'm executing a script that's in /usr/bin from /some/directory, the first entry in sys.path is /usr/bin. Is something misconfigured on my s...

How can I correct corrupted $PYTHONPATH?

Hello, When trying to launch Mercurial(hg) after a restart in my Ubuntu 9.10 Linux Box I got following message: abort: couldn't find mercurial libraries in [/usr/bin /usr/local/lib/python2.6/dist-packages/vipy-0.4-py2.6.egg /usr/local/lib/python2.6/dist-packages/nose-0.11.1-py2.6.egg /usr/local/lib/python2.6/dist-packages/rope-0....

Defining PYTHONPATH for http requests on a shared server

I'm installing Django on Bluehost and one of the steps to install it was to install flup on their server. I did so and everything works great when I'm logged in via the SSH. However when I actually hit the page in my browser it can't find flup. I get this error in the server log: ERROR: No module named flup. Unable to load the flup p...

PYTHONPATH vs. sys.path

Another developer and I disagree about whether PYTHONPATH or sys.path should be used to allow Python to find a Python package in a user (e.g., development) directory. We have a Python project with a typical directory structure: Project setup.py package __init__.py lib.py script.py In script.py, we need...

PyLint "Unable to import" error - how to set PYTHONPATH?

I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie. __init__.py myapp.py one.py subdir\ __init__.py two.py Inside two.py I have import one and this works fine at runtime, because the top-level directory (from which m...

Self-contained egg installs: turbogears and pythonpath

Hi there! I have a TG 1.0 application (not 1.1 -- I'm not sure I can convince the admin to upgrade) running. I have my own checkout of the project from cvs that I'm developing with, and it's come time to integrate xlwt (http://www.python-excel.org/) into the web app. However, I don't have administrator access and it's not easy to get ...

PYTHONPATH issue on a Production server and Namespace challenge

I'm really confused by some errors I'm getting as I'm trying to put an App into production. Everything works fine on the development machine, but I can't syncdb or enter the Django shell on the Production server. I'm getting an error when forum.models.py is attempts to import forum.managers.py because the models aren't in the namespace y...

How to set pythonpath (python2.6) for tkinter on Ubuntu 9.04 (to use nltk)?

I'd like to use the nltk toolkit on my machine which runs Ubuntu 9.04. I installed python 2.6.4 and several additional packages (numpy, scipy, matplotlib and of course nltk). I can import nltk, but calling a few methods gives various error masseges, all contain "please install Tkinter library". Googling around I discovered from http://wi...

Add directory to PYTHONPATH ( multiple drives ), for auto-complete.

I have 2 hard-drives, C:\ and D:\ Django imports correctly (which is in my C drive), but my application is on my D drive. I can't move it to the C drive because of some back-up software I'm running/ I'm trying to get auto-complete to work in Komodo Edit 5 which works fine for Django, but not for my application. There are a few other re...

Python: ImportError no module named urllib

I just rented a VPS from Linode, it has python2.5 and ubuntu 8.04 When I ho to python shell python import urllib I get ImportError: No module named urllib What can be the reason? How can I add this module to python? Isn't it prepackaged with the basic version? Can it be pythonpath problem? How I can test pythonpath? ...

How do I make PyScripter work? Says it cant find python26.dll

I installed PyScript to try it out but it just wont start. It only gives me the error: "Error126: Could not open Dll "python26.dll" followed by: "Python could not be properly initialized. We must quit." I think this may have something to do with the PYTHONPATH but since I'm a newbie and dont know what it is or exactly what to put in the...

Django and mod_python config

My Django project is placed in /www/host1/htdocs/my/project, www and my are links to other actual folders. Apache has mod_python enabled. I have a .htaccess in project folder: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE project.settings PythonDebug On PythonOption django.root ...

pythonpath issue? "python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory"

I added this line to my .bashrc (Ubuntu 9.10): export PYTHONPATH=/opt/google_appengine/ And then I ran the dev_appserver through python2.5 on Ubuntu like this: $ python2.5 dev_appserver.py guestbook/ python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory As you can see, it can't find dev_appserver.py eve...

I have a very long and repetitive python path, where do I look to correct this?

I know it is probably not necessary to paste the whole path, but just for the record I have done so below. Whenever I run a python command, it takes a long time to load this path I suppose. I have checked in .bash_profile and only have these two lines: export PATH=/Users/username/bin:/opt/local/Library/Frameworks/Python.framework/Versio...

Force import module from Python standard library instead of PYTHONPATH default

I have a custom module in one of the directories in my PYTHONPATH with the same name as one of the standard library modules, so that when I import module_name, that module gets loaded. If I want to use the original standard library module, is there any way to force Python to import from the standard library rather than from the PYTHONPAT...

Split Python source into separate directories?

Here are some various Python packages my company "foo.com" uses: com.foo.bar.web com.foo.bar.lib com.foo.zig.web com.foo.zig.lib com.foo.zig.lib.lib1 com.foo.zig.lib.lib2 Here's the traditional way to store the source on disk: pysrc/ com/ foo/ bar/ web/ lib/ zig/ web/ lib/ l...

PYTHONPATH and PHP

I have a PHP script that call a python script (someone else I can't edit). This work fine on CLI but once I run it as CGI it fails with the error "bzr: ERROR: Couldn't import bzrlib and dependencies." I guessed it has anything to do with PYTHONPATH so I echo it out and found that it was empty when in apache environment. I try setting i...

Python - How to PYTHONPATH with a complex directory structure?

Consider the following file\directory structure: project\ | django_project\ | | __init__.py | | django_app1\ | | | __init__.py | | | utils\ | | | | __init__.py | | | | bar1.py | | | | ... | | | ... | | django_app2\ | | | __init__.py | | | bar2.py | | | ... | | ... | scripts\ | | __init__.py | |...