This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: Not able install python-sqlite3 librabry

Part Number: AM3352


Hi All,

we are using 8.2.0.24 SDK 1.2. Building the SDK — Processor SDK Linux for AM335X Documentation in the host  ubuntu 18.04.

We need to install python-sqlite3 package as its required for our custom board/application 

we are not able to install, please let me know to reslove this below is the error which i am facing,

root@INKEO42659LNPR:~/tisdk/build$ MACHINE=am335x-evm bitbake python-sqlite3
NOTE: Started PRServer with DBfile: /home/sem3user/tisdk/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38017, PID: 61849
Loading cache: 100% |#########################################################################################################################################################| Time: 0:00:01
Loaded 4118 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:01
Parsing of 2923 .bb files complete (2922 cached, 1 parsed). 4119 targets, 602 skipped, 0 masked, 0 errors.
ERROR: Nothing PROVIDES 'python-sqlite3'. Close matches:
python3-git
python3-six
python3-sqlparse

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

please let us know how to resolve this

  • Hi Manu,

    Have you tried python3-sqlite3 package.

    Regards,

    Prashant

  • yes i have tried below is the logs

    root@INKEO42659LNPR:~/tisdk/build$ MACHINE=am335x-evm bitbake python3-sqlite3
    NOTE: Started PRServer with DBfile: /home/sem3user/tisdk/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 46841, PID: 40015
    Loading cache: 100% |#########################################################################################################################################################| Time: 0:00:00
    Loaded 4118 entries from dependency cache.
    Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:00
    Parsing of 2923 .bb files complete (2922 cached, 1 parsed). 4119 targets, 602 skipped, 0 masked, 0 errors.
    ERROR: Nothing PROVIDES 'python3-sqlite3'. Close matches:
    python3 RPROVIDES python3-sqlite3
    python3-git
    python3-six
    python3-sqlparse

    can you please help us to resolve

  • Hi Manu,

    Thank you for sharing the logs.

    I have assigned the query to our expert. He will get back to you.

    Regards,

    Prashant

  • yeah please Slight smile please push from your side

  • Hi Manu,

    what specific functionality do you think you are missing? sqlite3 Python bindings should readily be available (via 'import sqlite3') on our SDKs. See below example of booting the tisdk-default-image from the TI Processor SDK Linux v8.6 on an AM62-SK, and applying some simple tutorial steps taken from https://www.digitalocean.com/community/tutorials/how-to-use-the-sqlite3-module-in-python-3 that create a small database.

    <...snip...>
    [  OK  ] Stopped hmi_demo.service.
    [   14.362505] EXT4-fs (mmcblk1p2): resized filesystem to 3854976
    [  OK  ] Started LSB: Expand Rootfs of boot device.
    
     _____                    _____           _         _
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
                  |___|                    |___|
    
    Arago Project am62xx-evm ttyS2
    
    Arago 2021.09 am62xx-evm ttyS2
    
    am62xx-evm login: root
    root@am62xx-evm:~# python3
    Python 3.8.14 (default, Feb 24 2023, 06:11:59)
    [GCC 9.2.1 20191025] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqlite3
    >>> connection = sqlite3.connect("aquarium.db")
    >>> print(connection.total_changes)
    0
    >>> cursor = connection.cursor()
    >>> cursor.execute("CREATE TABLE fish (name TEXT, species TEXT, tank_number INTEGER)")
    <sqlite3.Cursor object at 0xffff9df00810>
    >>> cursor.execute("INSERT INTO fish VALUES ('Sammy', 'shark', 1)")
    <sqlite3.Cursor object at 0xffff9df00810>
    >>> cursor.execute("INSERT INTO fish VALUES ('Jamie', 'cuttlefish', 7)")
    <sqlite3.Cursor object at 0xffff9df00810>
    >>> rows = cursor.execute("SELECT name, species, tank_number FROM fish").fetchall()
    >>> print(rows)
    [('Sammy', 'shark', 1), ('Jamie', 'cuttlefish', 7)]
    >>> target_fish_name = "Jamie"
    >>> rows = cursor.execute(
    ...     "SELECT name, species, tank_number FROM fish WHERE name = ?",
    ...     (target_fish_name,),
    ... ).fetchall()
    >>> print(rows)
    [('Jamie', 'cuttlefish', 7)]
    >>> quit()
    root@am62xx-evm:~# ls -al
    total 20
    drwx------ 2 root root 4096 Feb 24 04:55 .
    drwxr-xr-x 3 root root 4096 Feb 24  2023 ..
    -rw------- 1 root root  692 Feb 24 04:55 .python_history
    -rw-r--r-- 1 root root 8192 Feb 24 04:54 aquarium.db
    root@am62xx-evm:~#

    Regards, Andreas

  • Thanks, Andreas

    we are using sqlite3 for storing the application related data and configuration of parameters of various modules. 

    when i boot i am able run sqlite3 binary. below is the logs,.

    now we have installed python3 and sqlite3 seperatly


    root@SMANU:~# python3
    Python 3.8.12 (default, Mar 16 2023, 05:21:38)
    [GCC 9.2.1 20191025] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqlite3
    >>>

    FYI, i am using AM3352 and SDK 8.2.0.24

    most of the python application we have written in python2 (as it was ported from old sdk where python2 was supported)

    I hope python3 is backward compatible to python2.. am i correct?

    or is there any changes is required in our application to work in python3? 

    suppose if we need python2.7 additionally with existing python3 ibn current SDK how can we do..?

  • most of the python application we have written in python2 (as it was ported from old sdk where python2 was supported)

    I hope python3 is backward compatible to python2.. am i correct?

    or is there any changes is required in our application to work in python3? 

    Yes there are changes that are required, but those are not too difficult to make. It'll be a good investment to future-proofing your code base & system.

    https://docs.python.org/3.8/howto/pyporting.html

    suppose if we need python2.7 additionally with existing python3 ibn current SDK how can we do..?

    Python 2 has essentially been obsoleted about 3 years ago. There are no more security(!) updates and such. Please review this page here: https://www.python.org/doc/sunset-python-2/ 

    Trying to resurrect Python 2 in Yocto is NOT something we recommend. It has been removed form Yocto Dunfell which is what our SDK v8.x is based off, see here: https://docs.yoctoproject.org/migration-guides/migration-3.1.html

    There's some legacy support for Python 2 in Yocto here https://git.openembedded.org/meta-python2/about/   Also note that how this page discourages the use of Python 2.

    Regards, Andreas

  • Thanks lot Andreas,

    We have also dependency on the "python-netserver python-misc python-pydoc python-json" as we have included in RDEPENDS in our bbfile.. we need to include individaully or is there any base pacakage which includes above all.. 

    as i am getting below error 

    Loading cache: 100% |#########################################################################################################################################################| Time: 0:00:01
    Loaded 4125 entries from dependency cache.
    Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:04
    Parsing of 2930 .bb files complete (2928 cached, 2 parsed). 4126 targets, 602 skipped, 2 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies
    ERROR: Nothing RPROVIDES 'python-netserver'

    I am seeing the same for all the libraries which we have mentioned in RDEPENDS

    ERROR: Nothing PROVIDES 'python-netserver'. Close matches:
    python3-jsonrpcserver

    ERROR: Nothing PROVIDES 'python-misc'. Close matches:
    python3-magic

    ERROR: Nothing PROVIDES 'python-pydoc'. Close matches:
    python3-py

    ERROR: Nothing PROVIDES 'python-json'. Close matches:
    python3-cson

    may i know how to resolve the above dependencies

  • We have also dependency on the "python-netserver python-misc python-pydoc python-json" as we have included in RDEPENDS in our bbfile.. we need to include individaully or is there any base pacakage which includes above all.. 

    All those dependencies should be provided by the main 'python3' recipe. Do you have this added to your image? As for the RDEPENDS, you'll need to list those individually, or create your own package group if that makes it easier to manage on your end across multiple recipes.

    What are you building that has these dependencies? If I can re-create the issue that you are seeing perhaps there's a different solution that's needed here.

    Regards, Andreas