[Python-apps-team] PYTHONPATH in debian/rules

BRAGA, Bruno bruno.braga at gmail.com
Wed Jul 25 07:31:47 UTC 2012


Hi Stefano,

Thanks, but that did not work. I keep seeing my module is not found. Here
is the output of buildpackage:

$ dpkg-buildpackage -rfakeroot
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor):
-D_FORTIFY_SOURCE=2
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor):
-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Wformat-security
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g
-O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor):
-Wl,-Bsymbolic-functions -Wl,-z,relro
dpkg-buildpackage: source package termsaver-figlet
dpkg-buildpackage: source version 0.1-1
dpkg-buildpackage: source changed by Bruno Braga <bruno.braga at gmail.com>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build termsaver-figlet_0.1
 fakeroot debian/rules clean
dh clean --with=python2
   dh_testdir
   dh_auto_clean
Traceback (most recent call last):
  File "setup.py", line 42, in <module>
    from figlet import constants
  File "/tmp/packaging/termsaver-figlet_0.1/figlet/constants.py", line 34,
in <module>
    from termsaverlib.constants import PropertyClass
ImportError: No module named termsaverlib.constants
dh_auto_clean: python setup.py clean -a returned exit code 1
make: *** [clean] Error 1
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit
status 2

To help a bit on the error above, here is my directory structure:
termsaver package is a standalone app installed on /usr/share/

$ tree /usr/share/termsaver/
/usr/share/termsaver/
├── termsaver
├── termsaver-0.1.2.egg-info
└── termsaverlib
    ├── common.py
    ├── constants.py
    ├── exception.py
    ├── i18n.py
    ├── __init__.py
    ├── plugins
    │   ├── __init__.py


Then what I am trying to achieve is to create a package for a plugin, which
will add code to a specific directory in the main package (at
/usr/share/termsaver/termsaverlib/plugins/).
doing it manually works, of course. with setup.py also works, as long as I
use the PYTHONPATH.... but in building the package it does not work, with
the error message above.

Any ideas?

--
*Braga, Bruno*
www.brunobraga.net
bruno.braga at gmail.com


On Tue, Jul 24, 2012 at 2:21 AM, Stefano Rivera <stefanor at debian.org> wrote:

> Hi BRAGA, (2012.07.23_15:59:34_+0200)
> > Hi debian/python gurus,
>
> Generally, debian-python at lists.debian.org is a better place for
> discussions.
>
> > I am packaging a plugin for another package I have, but it is held
> > privately, so I need to add the path to it in PYTHONPATH for running
> > setup.py.
>
> You probably want to use --install-lib not --prefix.
>
> Then you don't need to set PYTHONPATH.
>
> It ends up looking like:
>
> %:
>         dh $@ --with python2
>
> override_dh_auto_install:
>         dh_auto_install -- --install-lib /usr/share/foobar
>
> SR
>
> --
> Stefano Rivera
>   http://tumbleweed.org.za/
>   H: +27 21 461 1230 C: +27 72 419 8559
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20120725/eee8a16a/attachment.html>


More information about the Python-apps-team mailing list