Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named libvirt #21

Closed
Marietto2008 opened this issue Sep 11, 2021 · 8 comments
Closed

ImportError: No module named libvirt #21

Marietto2008 opened this issue Sep 11, 2021 · 8 comments

Comments

@Marietto2008
Copy link

Marietto2008 commented Sep 11, 2021

Hello.

I've just installed virt-manager with pkgin. Everything went ok. But,when I ran it,an error came up :

netbsd-marietto# virt-manager


Traceback (most recent call last):

File "/usr/pkg/share/virt-manager/virt-manager.py", line 386, in <module>

main()

File "/usr/pkg/share/virt-manager/virt-manager.py", line 247, in main

from virtManager import cli

File "/usr/pkg/share/virt-manager/virtManager/cli.py", line 29, in <module>

import libvirt

ImportError: No module named libvirt

Googling a little bit maybe I've found the solution here :

https://www.unitedbsd.com/d/285-linux-user-and-netbsd-enthusiast-hoping-to-migrate-some-day

where "kim" said :

Looking at pkgsrc/sysutils/libvirt/PLIST it doesn't look like the package provides any Python bindings -- which is what the "ImportError: No module named libvirt" error message is about. You could try py-libvirt from pkgsrc-wip and see how that works out.

I tried,but it didn't work :

netbsd-marietto# cd py-libvirt

netbsd-marietto# ls

DESCR Makefile PLIST distinfo distinfo.25058

netbsd-marietto# make

make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 15: Need an operator

make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 16: Need an operator

make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 17: Need an operator

make: Fatal errors encountered -- cannot continue

make: stopped in /home/mario/Desktop/pkgsrc-wip/py-libvirt

@Marietto2008
Copy link
Author

Marietto2008 commented Sep 11, 2021

gedit /home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile

#$NetBSD: Makefile,v 1.32 2018/11/30 09:59:40 adam Exp $

PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/-python//}
DISTNAME= libvirt-python-5.8.0
CATEGORIES= sysutils python
MASTER_SITES= https://libvirt.org/sources/python/

MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://libvirt.org/sources/python/
COMMENT= libvirt python library
LICENSE= gnu-lgpl-v2

USE_TOOLS+= pkg-config

#.include "../../wip/libvirt/buildlink3.mk"
#.include "../../lang/python/distutils.mk"
#.include "../../mk/bsd.pkg.mk"

.include "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk"
.include "/usr/pkgsrc/lang/python/distutils.mk"
.include "/usr/pkgsrc/mk/bsd.pkg.mk"

netbsd-marietto# make

make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 19: Need an operator
make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 20: Need an operator
make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 21: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /home/mario/Desktop/pkgsrc-wip/py-libvirt

@he32
Copy link
Contributor

he32 commented Sep 11, 2021 via email

@Marietto2008
Copy link
Author

Marietto2008 commented Sep 11, 2021

netbsd-marietto# make

make: "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk" line 11: Could not find ../../security/gnutls/buildlink3.mk
make: "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk" line 12: Could not find ../../textproc/libxml2/buildlink3.mk
make: "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk" line 13: Could not find ../../devel/yajl/buildlink3.mk
make: "/usr/pkgsrc/mk/bsd.fast.prefs.mk" line 7: Could not find ../../mk/bsd.prefs.mk
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 377: Cannot open /mk/defaults/mk.conf
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 395: Cannot open /mk/platform/NetBSD.mk
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 636: Cannot open /mk/tools/defaults.mk
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 638: Malformed conditional (${FETCH_USING} == "auto")
sh: 1: Syntax error: end of file unexpected
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 651: warning: "cd  && " returned non-zero status
sh: 1: Syntax error: end of file unexpected
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 671: warning: "cd /home/mario/Desktop/pkgsrc-wip/py-libvirt && " returned non-zero status
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 721: Malformed conditional (${PKGSRC_MKPIE:tl} == "yes" &&  ${MKPIE_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_MKPIE:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 731: Malformed conditional (${PKGSRC_MKREPRO:tl} == "yes" &&  ${MKREPRO_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_MKREPRO:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 742: Malformed conditional (${PKGSRC_USE_FORTIFY:tl} != "no" &&  ${FORTIFY_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_FORTIFY:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 753: Malformed conditional (${PKGSRC_USE_RELRO:tl} != "no" &&  ${RELRO_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_RELRO:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 765: Malformed conditional (${PKGSRC_USE_SSP:tl} != "no" &&  ${SSP_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_SSP:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 776: Malformed conditional (${PKGSRC_USE_STACK_CHECK:tl} != "no" &&  ${STACK_CHECK_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_STACK_CHECK:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 800: Malformed conditional (empty(PKGPATH:Mpkgtools/cwrappers) &&  (${USE_CWRAPPERS:tl} == "yes" ||  (${USE_CWRAPPERS:tl} == "auto" &&  ${_OPSYS_SUPPORTS_CWRAPPERS:Uno} == "yes")))
make: "/usr/pkgsrc/mk/wrapper/wrapper-defs.mk" line 33: Malformed conditional (${_USE_CWRAPPERS} == "yes")
sh: /usr/lib/libpthread.a: permission denied
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/libpthread.*`" != "/usr/lib/libpthread.*"; then   yes;                                                 else                                                             no;                                            fi" returned non-zero status
sh: /usr/lib/libc_r.*: not found
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/libc_r.*`" != "/usr/lib/libc_r.*"; then   yes;                                                 else                                                             no;                                            fi" returned non-zero status
sh: /usr/lib/librt.a: permission denied
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/librt.*`" != "/usr/lib/librt.*"; then   yes;                                           else                                                             no;                                            fi" returned non-zero status
make: "/usr/pkgsrc/mk/dlopen.builtin.mk" line 9: Could not find ../../mk/buildlink3/bsd.builtin.mk
sh: /usr/lib/libintl.a: permission denied
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/libintl.*`" != "/usr/lib/libintl.*"; then   yes;                                               else                                                             no;                                            fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q \#define\[\ \       \]\*__USE_GNU_GETTEXT /usr/include/libintl.h; then        /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q gentoo-multilib/.\*/libintl.h /usr/include/libintl.h; then    /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q char.\*ngettext /usr/include/libintl.h; then          /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q libgnuintl.h /usr/include/libintl.h; then     /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
make: "/usr/pkgsrc/mk/check/bsd.check-vars.mk" line 22: Malformed conditional (${_OPSYS_CAN_CHECK_SHLIBS:tl} == "yes")
sh: -n: not found
make: "/usr/pkgsrc/mk/unprivileged.mk" line 129: warning: " -n -u" returned non-zero status
sh: -n: not found
make: "/usr/pkgsrc/mk/unprivileged.mk" line 132: warning: " -n -g" returned non-zero status
sh: -n: not found
make: "/usr/pkgsrc/mk/unprivileged.mk" line 135: warning: " -n -G" returned non-zero status
make: "/usr/pkgsrc/mk/bsd.pkg.mk" line 426: Malformed conditional (${_USE_CWRAPPERS} == "yes")
sh: /pkg_admin: not found
sh: /pkg_admin: not found
make: "${PKG_TOOLS_BIN}/pkg_admin -K ${_CROSS_DESTDIR}/usr/pkg/pkgdb config-var PKGVULNDIR" returned non-zero status
make: Fatal errors encountered -- cannot continue
make: stopped in /home/mario/Desktop/pkgsrc-wip/py-libvirt

@he32
Copy link
Contributor

he32 commented Sep 11, 2021 via email

@Marietto2008
Copy link
Author

Marietto2008 commented Sep 11, 2021

No. The only thing that I did has been to comment these lines :

 .include "../../wip/libvirt/buildlink3.mk"
 .include "../../lang/python/distutils.mk"
 .include "../../mk/bsd.pkg.mk"

and I have changed the paths with these :


.include "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk"
.include "/usr/pkgsrc/lang/python/distutils.mk"
.include "/usr/pkgsrc/mk/bsd.pkg.mk"

because if I don't do that,I get the following error :

netbsd-marietto# make

make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 15: Could not find ../../wip/libvirt/buildlink3.mk
make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 16: Could not find ../../lang/python/distutils.mk
make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 17: Could not find ../../mk/bsd.pkg.mk
make: Fatal errors encountered -- cannot continue

@0-wiz-0
Copy link
Member

0-wiz-0 commented Sep 11, 2021

The pkgsrc-wip repository needs to be checked out as "wip" and put into /usr/pkgsrc (or wherever the rest of your pkgsrc checkout is).
I've just successfully built the wip/virt-manager package on NetBSD-9.99.88/amd64 (after fixing some minor issues in it and its dependencies). Make sure you have the latest pkgsrc-wip tree.

We do not use github issues, please use the pkgsrc-users@NetBSD.org mailing list instead.

@0-wiz-0 0-wiz-0 closed this as completed Sep 11, 2021
@Marietto2008
Copy link
Author

Marietto2008 commented Sep 11, 2021

I've already bootstrapped the pkgsrc. They are in /home/marietto/Desktop/pkgsrc-wip folder. Infact I have exchanged the paths stored in the Makefile with these :

.include "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk"
.include "/usr/pkgsrc/lang/python/distutils.mk"
.include "/usr/pkgsrc/mk/bsd.pkg.mk"

but I got the folowing situation :

netbsd-marietto# make

make: "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk" line 11: Could not find ../../security/gnutls/buildlink3.mk
make: "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk" line 12: Could not find ../../textproc/libxml2/buildlink3.mk
make: "/home/mario/Desktop/pkgsrc-wip/libvirt/buildlink3.mk" line 13: Could not find ../../devel/yajl/buildlink3.mk
make: "/usr/pkgsrc/mk/bsd.fast.prefs.mk" line 7: Could not find ../../mk/bsd.prefs.mk
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 377: Cannot open /mk/defaults/mk.conf
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 395: Cannot open /mk/platform/NetBSD.mk
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 636: Cannot open /mk/tools/defaults.mk
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 638: Malformed conditional (${FETCH_USING} == "auto")
sh: 1: Syntax error: end of file unexpected
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 651: warning: "cd  && " returned non-zero status
sh: 1: Syntax error: end of file unexpected
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 671: warning: "cd /home/mario/Desktop/pkgsrc-wip/py-libvirt && " returned non-zero status
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 721: Malformed conditional (${PKGSRC_MKPIE:tl} == "yes" &&  ${MKPIE_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_MKPIE:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 731: Malformed conditional (${PKGSRC_MKREPRO:tl} == "yes" &&  ${MKREPRO_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_MKREPRO:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 742: Malformed conditional (${PKGSRC_USE_FORTIFY:tl} != "no" &&  ${FORTIFY_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_FORTIFY:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 753: Malformed conditional (${PKGSRC_USE_RELRO:tl} != "no" &&  ${RELRO_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_RELRO:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 765: Malformed conditional (${PKGSRC_USE_SSP:tl} != "no" &&  ${SSP_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_SSP:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 776: Malformed conditional (${PKGSRC_USE_STACK_CHECK:tl} != "no" &&  ${STACK_CHECK_SUPPORTED:Uyes:tl} == "yes" &&  ${_OPSYS_SUPPORTS_STACK_CHECK:Uno} == "yes")
make: "/usr/pkgsrc/mk/bsd.prefs.mk" line 800: Malformed conditional (empty(PKGPATH:Mpkgtools/cwrappers) &&  (${USE_CWRAPPERS:tl} == "yes" ||  (${USE_CWRAPPERS:tl} == "auto" &&  ${_OPSYS_SUPPORTS_CWRAPPERS:Uno} == "yes")))
make: "/usr/pkgsrc/mk/wrapper/wrapper-defs.mk" line 33: Malformed conditional (${_USE_CWRAPPERS} == "yes")
sh: /usr/lib/libpthread.a: permission denied
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/libpthread.*`" != "/usr/lib/libpthread.*"; then   yes;                                                 else                                                             no;                                            fi" returned non-zero status
sh: /usr/lib/libc_r.*: not found
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/libc_r.*`" != "/usr/lib/libc_r.*"; then   yes;                                                 else                                                             no;                                            fi" returned non-zero status
sh: /usr/lib/librt.a: permission denied
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/librt.*`" != "/usr/lib/librt.*"; then   yes;                                           else                                                             no;                                            fi" returned non-zero status
make: "/usr/pkgsrc/mk/dlopen.builtin.mk" line 9: Could not find ../../mk/buildlink3/bsd.builtin.mk
sh: /usr/lib/libintl.a: permission denied
sh: : not found
sh: no: not found
make: "/usr/pkgsrc/mk/buildlink3/find-libs.mk" line 65: warning: "if  "` /usr/lib/libintl.*`" != "/usr/lib/libintl.*"; then   yes;                                               else                                                             no;                                            fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q \#define\[\ \       \]\*__USE_GNU_GETTEXT /usr/include/libintl.h; then        /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q gentoo-multilib/.\*/libintl.h /usr/include/libintl.h; then    /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q char.\*ngettext /usr/include/libintl.h; then          /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
sh: -q: not found
sh: __nonexistent__: not found
make: "/usr/pkgsrc/mk/buildlink3/find-headers.mk" line 92: warning: "if  -q libgnuintl.h /usr/include/libintl.h; then     /usr/include/libintl.h;                                else                                                             __nonexistent__;                               fi" returned non-zero status
make: "/usr/pkgsrc/mk/check/bsd.check-vars.mk" line 22: Malformed conditional (${_OPSYS_CAN_CHECK_SHLIBS:tl} == "yes")
sh: -n: not found
make: "/usr/pkgsrc/mk/unprivileged.mk" line 129: warning: " -n -u" returned non-zero status
sh: -n: not found
make: "/usr/pkgsrc/mk/unprivileged.mk" line 132: warning: " -n -g" returned non-zero status
sh: -n: not found
make: "/usr/pkgsrc/mk/unprivileged.mk" line 135: warning: " -n -G" returned non-zero status
make: "/usr/pkgsrc/mk/bsd.pkg.mk" line 426: Malformed conditional (${_USE_CWRAPPERS} == "yes")
sh: /pkg_admin: not found
sh: /pkg_admin: not found
make: "${PKG_TOOLS_BIN}/pkg_admin -K ${_CROSS_DESTDIR}/usr/pkg/pkgdb config-var PKGVULNDIR" returned non-zero status
make: Fatal errors encountered -- cannot continue
make: stopped in /home/mario/Desktop/pkgsrc-wip/py-libvirt


@0-wiz-0
Copy link
Member

0-wiz-0 commented Sep 12, 2021

Please use the mailing list, as I said above.

You need to get a checkout of pkgsrc in source form, e.g. in /home/marietto/Desktop/pkgsrc; then you need to put the checkout of the wip repository at /home/marietto/Desktop/pkgsrc/wip.

The bootstrap destination is for the binaries, not the sources. If you bootstrapped into /home/marietto/Desktop/pkgsrc-wip you will find your binaries in /home/marietto/Desktop/pkgsrc-wip/bin

You still need the pkgsrc sources separately (see above).

wip-sync pushed a commit that referenced this issue Jun 21, 2024
0.6.6 (2023-10-03)
Bug fixes
    Fix PyMem_Calloc() call signature. (#76)
Contributors
    @dholth
    @kenodegard

0.6.5 (2023-10-02)
Enhancements
    Update Python version support. (#56)
Bug fixes
    Use PyMem_Calloc() to initialize memory to 0. (#58)
Contributors
    @conda-bot
    @dholth made their first contribution in #54
    @kenodegard

0.6.4 (2022-10-24)
    Fix memory leak in blocksol() when iterating over solutions

0.6.3 (2017-10-29)
    Revert 'always use Python memory manager'

0.6.2 (2017-03-16)
    update picosat to 965
    fixed version attribute on Windows, #21
    fix some typos
    add official Python 3.5 and 3.6 support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants