• python issues in Mystic

    From Gryphon@21:1/120 to All on Tuesday, December 05, 2017 16:02:37
    I'm trying to write and MPY app that uses sqlite3 to manage the app data.
    But I'm getting errors just trying to import the sqlite3 module.

    I'm running on 64-bit linux and using python2.7 (of course)

    My env is set up properly I expect:
    bbs@cyberia:~/scripts$ echo $PYTHONPATH
    /usr/bin/python
    bbs@cyberia:~/scripts$ echo $PYTHONHOME
    /usr/lib/python2.7

    My code has the proper import format:
    ------------
    from mystic_bbs import *
    import sqlite3

    But when I run the app, I get this error: -----------------------------------------
    File "/usr/lib/sqlite3/dbapi1.py", line 28, in <module>
    from _sqlite3 import *
    ImportError: /usr/lib/pythPress a Key


    The "Press a Key" is part of the output. Unfortunately it obscures the relevant part of the error and I don't know how to make it go away.

    One thing I did notice is that there is no /usr/lib/sqlite3 directory. I figured it was some error with the installation, so I removed and reinstalled python-sqlite3. But I still get the error.

    Has anybody else tried adding sqlite3 to an MPY app? If so, did you
    encounter this error?

    --- Mystic BBS v1.12 A36 2017/12/03 (Linux/64)
    * Origin: Cyberia BBS | cyberia.darktech.org | San Jose, CA (21:1/120)
  • From Nugax@21:1/107 to All on Tuesday, December 05, 2017 20:58:27
    I did it with ease in perl

    On 10:02 05/12 , Gryphon wrote:
    I'm trying to write and MPY app that uses sqlite3 to manage the app data. >But I'm getting errors just trying to import the sqlite3 module.

    I'm running on 64-bit linux and using python2.7 (of course)

    My env is set up properly I expect:
    bbs@cyberia:~/scripts$ echo $PYTHONPATH
    /usr/bin/python
    bbs@cyberia:~/scripts$ echo $PYTHONHOME
    /usr/lib/python2.7

    My code has the proper import format:
    ------------
    from mystic_bbs import *
    import sqlite3

    But when I run the app, I get this error: >-----------------------------------------
    File "/usr/lib/sqlite3/dbapi1.py", line 28, in <module>
    from _sqlite3 import *
    ImportError: /usr/lib/pythPress a Key


    The "Press a Key" is part of the output. Unfortunately it obscures the >relevant part of the error and I don't know how to make it go away.

    One thing I did notice is that there is no /usr/lib/sqlite3 directory. I >figured it was some error with the installation, so I removed and reinstalled >python-sqlite3. But I still get the error.

    Has anybody else tried adding sqlite3 to an MPY app? If so, did you >encounter this error?

    --- Mystic BBS v1.12 A36 2017/12/03 (Linux/64)
    * Origin: Cyberia BBS | cyberia.darktech.org | San Jose, CA (21:1/120)


    --
    yrNews Usenet Reader for iOS
    http://appstore.com/yrNewsUsenetReader

    --- Mystic BBS/NNTP v1.12 A36 2017/12/03 (Linux/64)
    * Origin: -=The ByteXchange BBS : bbs.thebytexchange.com=- (21:1/107)