On 11/16/20 12:29 AM, n952162 wrote:
On 11/16/20 12:26 AM, cal wrote:
On 11/15/20 3:20 PM, n952162 wrote:
On 11/16/20 12:17 AM, cal wrote:
On 11/15/20 3:10 PM, n952162 wrote:
On 11/16/20 12:06 AM, Manuel McLure wrote:


On Sun, Nov 15, 2020 at 2:59 PM n952162 <n952...@web.de
<mailto:n952...@web.de>> wrote:

    I'm trying to convert python2 scripts to python3.  A script
which
    works under python2 gives me this under python3:

        ModuleNotFoundError: No module named 'sqlite3'

    Any ideas?

You might need to add "sqlite" to the USE flags for dev-lang/python
and reinstall.

--
Manuel A. McLure WW1FA <man...@mclure.org
<mailto:man...@mclure.org>>
<http://www.mclure.org <http://www.mclure.org>>
...for in Ulthar, according to an ancient and significant law,
no man may kill a cat.                       -- H.P. Lovecraft

$ equery uses python
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
  * Found these USE flags for dev-lang/python-3.8.5:
  U I
  - - bluetooth : Build Bluetooth protocol support in socket module
  - - build     : !!internal use only!! DO NOT SET THIS FLAG
YOURSELF!,
used for creating build images and the first half of bootstrapping
[make
stage1]
  - - examples  : Install examples, usually source code
  + + gdbm      : Add support for sys-libs/gdbm (GNU database
libraries)
  - - hardened  : Activate default security enhancements for
toolchain
(gcc, glibc, binutils)
  + + ipv6      : Add support for IP version 6
  - - libressl  : Use dev-libs/libressl instead of
dev-libs/openssl when
applicable (see also the ssl useflag)
  + + ncurses   : Add ncurses support (console display library)
  + + readline  : Enable support for libreadline, a GNU line-editing
library that almost everyone wants
* + + sqlite    : Add support for sqlite - embedded sql database*
  + + ssl       : Add support for SSL/TLS connections (Secure Socket
Layer / Transport Layer Security)
  - - test      : Enable dependencies and/or preparations
necessary to
run tests (usually controlled by FEATURES=test but can be toggled
independently)
  - - tk        : Add support for Tk GUI toolkit
  - - wininst   : Install Windows executables required to create an
executable installer for MS Windows.
  + + xml       : Add support for XML files




(My apologies, forgot to include the list on my previous reply)
What is the output of `python --version` for the interpreter you are
using to execute this script?  Is it possible that your default
python3 interpreter is not 3.8.5 and has different USE flags?  (Keep
in mind, there may be multiple versions of python3 installed in
different slots).

For example, on my machine, /usr/bin/python points to Python 3.6.12,
while equery uses python displays the USE flags for 3.9.0:

$ python --version
Python 3.6.12
$ equery uses python
 * Found these USE flags for dev-lang/python-3.9.0:
[...]
$ equery uses dev-lang/python:3.6
 * Found these USE flags for dev-lang/python-3.6.12:
[...]

You can set the default Python interpreter with eselect python list /
eselect python set.

Cal

$  python --version
Python 3.7.9

$ python
Python 3.7.9 (default, Oct 21 2020, 22:22:16)
...

And what is the output of `equery uses dev-lang/python:3.7`? Your
output earlier in the thread is displaying the USE flags for the 3.8
slot.

If you wish to enable sqlite3 for all python interpreters, you can
add `dev-lang/python sqlite` to your package.use.

Cal


Yes, I was just following up on that, and it looks like you figured it
out:

$ equery uses python:3.7
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for dev-lang/python-3.7.9:
 U I
 - - bluetooth : Build Bluetooth protocol support in socket module
 - - build     : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!,
used for creating build images and the first half of bootstrapping
[make stage1]
 - - examples  : Install examples, usually source code
 + + gdbm      : Add support for sys-libs/gdbm (GNU database libraries)
 - - hardened  : Activate default security enhancements for toolchain
(gcc, glibc, binutils)
 + + ipv6      : Add support for IP version 6
 - - libressl  : Use dev-libs/libressl instead of dev-libs/openssl
when applicable (see also the ssl useflag)
 + + ncurses   : Add ncurses support (console display library)
 + + readline  : Enable support for libreadline, a GNU line-editing
library that almost everyone wants
*+ - *sqlite : Add support for sqlite - embedded sql database


I accumulate all the use flags from all my machines when I do, e.g. a
re-installation (this case).  This is what I currently have  :-)

$ grep python * | grep sqlite
all:>=dev-lang/python-3.8.5 sqlite
use-flags-201110:>=dev-lang/python-2.7.14-r1:2.7 sqlite
use-flags-201110:>=dev-lang/python-2.7.16:2.7 sqlite
use-flags-201110:>=dev-lang/python-2.7.17:2.7 sqlite
use-flags-201110:>=dev-lang/python-3.6.9 sqlite
use-flags-201110:>=dev-lang/python-3.6.9:3.6 sqlite
use-flags-201110:>=dev-lang/python-3.8.5 sqlite

Thanks for the tip...


Reply via email to