[Debian-med-packaging] Bug#739631: [Help] Bug#739631: python-pysam: FTBFS: ImportError: No module named pysam

Andreas Tille tille at debian.org
Thu Feb 20 18:24:45 UTC 2014


Hi Jacub,

On Thu, Feb 20, 2014 at 06:44:00PM +0100, Jakub Wilk wrote:
> | running build
> | running build_py
> | creating build
> | creating build/lib.linux-i686-2.7
> | creating build/lib.linux-i686-2.7/pysam
> [...]
> | + env PYTHONPATH=/build/python-pysam-fLMqAQ/python-pysam-0.7.5/build/lib.linux-i486-2.7 ./pysam_test_offline.py
> | Traceback (most recent call last):
> |   File "./pysam_test_offline.py", line 8, in <module>
> |     import pysam
> | ImportError: No module named pysam
> | make[1]: *** [override_dh_auto_test] Error 1
> 
> So setup.py installed stuff to "build/lib.linux-i686-2.7", but
> PYTHONPATH is set to "build/lib.linux-i486-2.7".

I think I understood the problem ...
 
> /usr/share/python/python.mk defines a macro for determining build
> directory. You might want to use it. :)

... but not the suggested solution.  I tried:

$ git diff debian/rules
diff --git a/debian/rules b/debian/rules
index 50d4cad..073f3b1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,7 +10,8 @@ export PYBUILD_NAME=pysam
 
 DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
 TESTPKG    := $(DEBPKGNAME)-tests
-pybuilddir := $(CURDIR)/build/lib.$(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)-$(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
+
+include /usr/share/python/python.mk
 
 %:
        dh $@ --with python2
@@ -38,7 +39,7 @@ override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
        set -e -x;\
        for pyv in `pyversions -dv` ; do \
-           cd tests && env PYTHONPATH=$(pybuilddir)-$${pyv} ./pysam_test_offline.py ; \
+           cd tests && env PYTHONPATH=$(py_builddir) ./pysam_test_offline.py ; \
        done
 endif


which leads to:

dh_auto_test
chmod a+x tests/pysam_test_offline.py
set -e -x;\
        for pyv in `pyversions -dv` ; do \
            cd tests && env PYTHONPATH=build/lib.linux-x86_64-2.7 ./pysam_test_offline.py ; \
        done
+ pyversions -dv
+ cd tests
+ env PYTHONPATH=build/lib.linux-x86_64-2.7 ./pysam_test_offline.py
Traceback (most recent call last):
  File "./pysam_test_offline.py", line 8, in <module>
    import pysam
ImportError: No module named pysam


So how exactly do you want me to use a variable from
/usr/share/python/python.mk?

Kind regards

      Andreas.

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list