From: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: Andy Grover <agrover@redhat.com>,
targetcli-fb-devel@lists.fedorahosted.org,
linux-modules <linux-modules@vger.kernel.org>
Subject: Re: Debugging AttributeError: 'module' object has no attribute 'kmod'
Date: Sat, 15 Nov 2014 21:59:49 +0100 [thread overview]
Message-ID: <20141115215949.13633c93@trantor> (raw)
In-Reply-To: <CAKi4VAKboFTst4_Th19aVpu0GrYtqbw-t=-1MCzn-ScJCAaGEQ@mail.gmail.com>
Hi,
On Sat, 15 Nov 2014 11:34:56 -0200, Lucas De Marchi wrote :
> >>>> Trying to use python-kmod by hand also fails on the system.
> >>>>
> >>>> Python 3.4.1 (default, Oct 29 2014, 13:37:35)
> >>>> [GCC 4.9.1] on linux
> >>>> Type "help", "copyright", "credits" or "license" for more
> >>>> information.
> >>>> >>> import kmod
> >>>> >>> km = kmod.kmod()
>
> it should be kmod.Kmod()
>
> Note the capital K.
Yes.
I tested kmod with Python 3 outside of Buildroot and it works fine.
However, with Buildroot there is a problem because Buildroot generates a
Python 3 installation that does not follow PEP 3147 "PYC Repository
Directories". This means that *.py[co] files are not installed in
__pycache__ directories and this makes python-kmod fail. But this is
problem with Buildroot's Python 3 installation. There is no issue with
Kmod here.
Thanks!
> > (CCing kmod dev list too)
> >
> > Starting in kmod v17 the Python library was merged into the main
> > kmod repo, and the version indicates that you are using the Python
> > wrapper built from that (as opposed to the now-defunct separate
> > project called python-kmod, whose versions never exceeded 0.9.)
> >
> > Lucas De Marchi did the build integration because my autotools
> > knowledge was not sufficient -- I suspect building kmod with
> > --enable-python only enables Python 2. I'd need to know more about
> > what distro you're on and look at the packaging scripts, but I
> > think upstream support for building the library for Python 3 is
> > needed (this might be extremely simple but it still probably
> > requires a separate --enable-python3 configure option). Did the
> > packager think they could just take the Py2 binaries and they'd
> > work for Python 3???
> >
> > So I'd open an issue with the kmod packager for whatever distro
> > because something is broken, and maybe the CC'd upstream developers
> > might also be able to help us have explicit support for building
> > for Python 3?
>
> It should work fine with python3 as well. Just tested here:
>
> $ make install DESTDIR=/tmp/inst
> $ PYTHONPATH=/tmp/inst/usr/lib/python3.4/site-packages python3
> Python 3.4.2 (default, Oct 8 2014, 13:44:52)
> [GCC 4.9.1 20140903 (prerelease)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import kmod
> >>> km = kmod.Kmod()
> >>> km.loaded()
> <generator object at 0x7fbf9f807cc8>
>
--
Christophe Vu-Brugier
prev parent reply other threads:[~2014-11-15 20:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20141030160932.15107fde@PAL-U515208D001>
[not found] ` <54526645.2010008@redhat.com>
[not found] ` <20141030173744.681f77df@PAL-U515208D001>
2014-10-30 18:36 ` Debugging AttributeError: 'module' object has no attribute 'kmod' Andy Grover
2014-11-15 13:34 ` Lucas De Marchi
2014-11-15 20:59 ` Christophe Vu-Brugier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141115215949.13633c93@trantor \
--to=cvubrugier@fastmail.fm \
--cc=agrover@redhat.com \
--cc=linux-modules@vger.kernel.org \
--cc=lucas.de.marchi@gmail.com \
--cc=targetcli-fb-devel@lists.fedorahosted.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.