I'm trying to set up an external program / lib written in python - on debian squeeze.
The error I get when I try to launch it that the "environment variable is not set" - it's an exception throw by the developer. So I guess, I have to define it, but where ?
- I've thought virtualenv and path were the same, so I've written a .pth loaded at the launch. It solved some mistake but not all.
- I've read use export in
~/.bashrcbut I'm not sure it is read in a virtualenv, and I don't want those export be read even when I don't use this virtualenv. - I've read too to use export in
virtualenv/bin/activate, but it doesn't seem to work correctly.
I'm trying to install Opus and Urbansim.
Here is what I get when launching:
(opus-env)touki@touki:~/Projects/opus-env$ ./src/opus_gui/opus.py
Traceback (most recent call last):
File "./src/opus_gui/opus.py", line 14, in <module>
from opus_gui.main.controllers.opus_gui_configuration import OpusGuiConfiguration
File "/home/touki/Projects/opus-test/src/opus_gui/main/controllers/opus_gui_configuration.py", line 12, in <module>
from opus_core import paths
File "/home/touki/Projects/opus-test/src/opus_core/paths.py", line 44, in <module>
OPUS_HOME = _safe_getenv('OPUS_HOME', _get_default_opus_home)
File "/home/touki/Projects/opus-test/src/opus_core/paths.py", line 33, in _safe_getenv
return os.environ[key] if key in os.environ else default_func()
File "/home/touki/Projects/opus-test/src/opus_core/paths.py", line 36, in _get_default_opus_home
raise Exception('OPUS_HOME environment variable must be set.')
Exception: OPUS_HOME environment variable must be set.
NB.: I've searched, autoenv combine virtualenvwrapper seems to provide an answer, but I would prefer not use external programs.
exportinstructions as detailed in the setup guide you linked to, then open a new terminal where those environment variables will be defined by the shell..bashrcis read by your shell, and it'll be set for every session.