Gentoo Archives: gentoo-user

From: n952162 <n952162@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] sqlite3 not available in python3?
Date: Sun, 15 Nov 2020 23:24:56
Message-Id: 1ad748d8-c1b6-7e00-4a74-42d8aa790160@web.de
In Reply to: Re: [gentoo-user] sqlite3 not available in python3? by cal
1 On 11/16/20 12:17 AM, cal wrote:
2 > On 11/15/20 3:10 PM, n952162 wrote:
3 >> On 11/16/20 12:06 AM, Manuel McLure wrote:
4 >>>
5 >>>
6 >>> On Sun, Nov 15, 2020 at 2:59 PM n952162 <n952162@×××.de
7 >>> <mailto:n952162@×××.de>> wrote:
8 >>>
9 >>>     I'm trying to convert python2 scripts to python3.  A script which
10 >>>     works under python2 gives me this under python3:
11 >>>
12 >>>         ModuleNotFoundError: No module named 'sqlite3'
13 >>>
14 >>>     Any ideas?
15 >>>
16 >>> You might need to add "sqlite" to the USE flags for dev-lang/python
17 >>> and reinstall.
18 >>>
19 >>> --
20 >>> Manuel A. McLure WW1FA <manuel@××××××.org <mailto:manuel@××××××.org>>
21 >>> <http://www.mclure.org <http://www.mclure.org>>
22 >>> ...for in Ulthar, according to an ancient and significant law,
23 >>> no man may kill a cat.                       -- H.P. Lovecraft
24 >>
25 >> $ equery uses python
26 >> [ Legend : U - final flag setting for installation]
27 >> [        : I - package is installed with flag     ]
28 >> [ Colors : set, unset                             ]
29 >>   * Found these USE flags for dev-lang/python-3.8.5:
30 >>   U I
31 >>   - - bluetooth : Build Bluetooth protocol support in socket module
32 >>   - - build     : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!,
33 >> used for creating build images and the first half of bootstrapping [make
34 >> stage1]
35 >>   - - examples  : Install examples, usually source code
36 >>   + + gdbm      : Add support for sys-libs/gdbm (GNU database libraries)
37 >>   - - hardened  : Activate default security enhancements for toolchain
38 >> (gcc, glibc, binutils)
39 >>   + + ipv6      : Add support for IP version 6
40 >>   - - libressl  : Use dev-libs/libressl instead of dev-libs/openssl when
41 >> applicable (see also the ssl useflag)
42 >>   + + ncurses   : Add ncurses support (console display library)
43 >>   + + readline  : Enable support for libreadline, a GNU line-editing
44 >> library that almost everyone wants
45 >> * + + sqlite    : Add support for sqlite - embedded sql database*
46 >>   + + ssl       : Add support for SSL/TLS connections (Secure Socket
47 >> Layer / Transport Layer Security)
48 >>   - - test      : Enable dependencies and/or preparations necessary to
49 >> run tests (usually controlled by FEATURES=test but can be toggled
50 >> independently)
51 >>   - - tk        : Add support for Tk GUI toolkit
52 >>   - - wininst   : Install Windows executables required to create an
53 >> executable installer for MS Windows.
54 >>   + + xml       : Add support for XML files
55 >>
56 >>
57 >>
58 >
59 > (My apologies, forgot to include the list on my previous reply)
60 > What is the output of `python --version` for the interpreter you are
61 > using to execute this script?  Is it possible that your default
62 > python3 interpreter is not 3.8.5 and has different USE flags?  (Keep
63 > in mind, there may be multiple versions of python3 installed in
64 > different slots).
65 >
66 > For example, on my machine, /usr/bin/python points to Python 3.6.12,
67 > while equery uses python displays the USE flags for 3.9.0:
68 >
69 > $ python --version
70 > Python 3.6.12
71 > $ equery uses python
72 >  * Found these USE flags for dev-lang/python-3.9.0:
73 > [...]
74 > $ equery uses dev-lang/python:3.6
75 >  * Found these USE flags for dev-lang/python-3.6.12:
76 > [...]
77 >
78 > You can set the default Python interpreter with eselect python list /
79 > eselect python set.
80 >
81 > Cal
82 >
83
84 Thank you for the tip on "eselect":
85
86 $ eselect python list
87 Available Python interpreters, in order of preference:
88   [1]   python3.7
89   [2]   python3.8 (fallback)
90   [3]   python3.6 (fallback)