Questions tagged [pythonpath]

PYTHONPATH is an environment variable that can be used to augment the default search path for module imports in Python.

PYTHONPATH is an environment variable that can be used to augment the default search path for module files in Python. Values will be added to sys.path.

758 questions
5
votes
1 answer

Adding custom dir to PYTHONPATH

I've been trying to add a custom directory to PYTHONPATH following the advice on this post Permanently add a directory to PYTHONPATH. I'm using bash on a Mac, if that's relevant. This is what I did: open ~/.bash_profile export…
zzhengnan
  • 405
  • 3
  • 6
  • 14
5
votes
2 answers

Python: include a third party library in a personal Python package

I would like to include a third party library into my Python script folder to distribute it all togehter (I am awary of the distribution license, and this library is fine to distribute). This is in order to avoid installing the library on another…
umbe1987
  • 2,894
  • 6
  • 35
  • 63
5
votes
3 answers

How to get Python location using Windows batch file?

I need to create a windows batch script which creates and moves one specific file to PYTHONPATH\Lib\distutils folder. Here is what I am attempting to do: ECHO [build] >> distutils.cfg ECHO compiler=mingw32 >> distutils.cfg MOVE distutils.cfg…
minerals
  • 6,090
  • 17
  • 62
  • 107
5
votes
1 answer

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…
NawaMan
  • 25,129
  • 10
  • 51
  • 77
5
votes
1 answer

Eclipse/PyDev: Sync System PYTHONPATH runs continuously

When Eclipse/PyDev is open I see an operation running in the background, over and over (as if stuck in an infinite loop), in the lower right status area telling me "Sync System PYTHONPATH (100%)". I have a single Python interpreter configured,…
James Adams
  • 8,448
  • 21
  • 89
  • 148
5
votes
4 answers

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…
Alex
  • 731
  • 1
  • 11
  • 24
5
votes
1 answer

should pythonpath have directories specific to python2 and python3?

I am working with both python 2 and python 3 on a daily basis. Should I be adding paths to PYTHONPATH that are specific to a python version, like the following, which is specific to python 2? /usr/local/lib/python2.7/dist-packages If the answer is…
Ofer
  • 2,883
  • 2
  • 17
  • 16
5
votes
1 answer

Where's the recommended place to put small python convenience modules

I've amassed a small collection of small handy ad hoc scripts that I would like to have available to me in all my python projects and ipython interactive sessions. I would like to add to and clean up this collection without having to worry about…
Noah
  • 196
  • 10
5
votes
1 answer

VCS and Python project structure: How to setup the PYTHONPATH automatically?

There are many suggestions on the web what the structure of the Python project can/shall be, e.g. What is the best project structure for a Python application?. "proj-dir" +- doc +- apidoc +- scripts +- "src-dir" +- tests It seems that many people…
Posa
  • 320
  • 3
  • 8
5
votes
1 answer

Python Module imports in Terminal but not through Unix Shell

I'm just getting started with Python and need a little guidance. I'm using a Mac, but I have a python.org build of python installed as well as the original Apple install. I'm trying to load up some 3rd party modules. When I run the script in IDLE or…
5
votes
3 answers

How to permanently append a directory to PYTHONPATH?

I attempted the two commonly mentioned methods below, and they have not worked - hence this [seemingly redundant] question. import sys sys.path.append('foo/bar') AND export PYTHONPATH=$PYTHONPATH:foo/bar The first one terminates the append once…
entrepaul
  • 927
  • 3
  • 12
  • 23
5
votes
2 answers

Problems with psycopg2 installation/Python path

I created a virtualenv in my django app folder, and there I installed all my python dependencies. My Django project is called theme, so in the theme folder there is a venv folder that contains the python libs. If I run python manage.py syncdb it…
leonsas
  • 4,718
  • 6
  • 43
  • 70
5
votes
1 answer

No module named query on haystack

I was using haystack on my Windows computer, but I realized I needed other modules for my django app that are easier to install on Linux, so I moved to my VirtualBox with Ubuntu. I installed everything with virtualenv in a venv folder. Basically my…
leonsas
  • 4,718
  • 6
  • 43
  • 70
4
votes
2 answers

Django Management Command ImportError

I have problem with imported module into my qsl/management/commands/.py file. in fact, my app structure is : qsl/management/commands/ : dir for my management commands qsl/management/jobs/ : dir for my mangement jobs jobs are python…
k.elkourchi
  • 121
  • 1
  • 5
4
votes
2 answers

proper way to distribute run scripts with python package?

Suppose I have a python package called mypackage, which has a series of scripts. Once mypackage is in the site-packages dir, the user can refer to various Python files within mypackage as mypackage.submodule1, mypackage.submodule2 from Python, as…
user248237