Python

Python

Python

 View Only
  • 1.  ModuleNotFoundError: No module named 'zoautil_py' when running: python3 -c "import zoautil_py;print(zoautil_py.__name__)"

    Posted Mon April 19, 2021 09:57 AM

    Hello 

    I'm getting ModuleNotFound when using zoau. How can I fix this ?

    What are the compile instructions for /usr/lpp/zoau/zoautil_py/zoautil_py/src/core.c  ?

    > printenv PATH
    /usr/lpp/zoau/bin:/usr/lpp/python39/bin:/bin:/sbin:/usr/local/bin
    > printenv LIBPATH
    /usr/lpp/zoau/lib:/usr/lpp/python/v3r9/pyz/lib
    > printenv PYTHONPATH
    /usr/lpp/zoau/zoautil_py/zoautil_py:/usr/lpp/python/v3r9/pyz/lib/python3.9
    > printenv PYTHON_HOME
    /usr/lpp/python39
    > printenv ZOAU_HOME
    /usr/lpp/zoau

    > python3 --version
    Python 3.9.0

    > zoaversion
    2020/09/25 14:07:34 CUT V1.1.0

    > python3 -c "import zoautil_py; print(zoautil_py.__name__)"
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'zoautil_py'
    >



    ------------------------------
    Matthias Rabast
    ------------------------------


  • 2.  RE: ModuleNotFoundError: No module named 'zoautil_py' when running: python3 -c "import zoautil_py;print(zoautil_py.__name__)"

    Posted Mon April 19, 2021 12:58 PM
    Hi Matthias,

    It looks like you have successfully installed zoau, but not the Python package required to interface to it, the steps to do so are described here: https://www.ibm.com/docs/en/zoau/1.1.0?topic=installing-configuring-zoa-utilities in particular step 7-d.

    pip3 install zoautil_py-<version>.tar.gz

    This should resolve the problem.

    Thanks,
    Austin S. Wells



    ------------------------------
    Austin Wells
    ------------------------------



  • 3.  RE: ModuleNotFoundError: No module named 'zoautil_py' when running: python3 -c "import zoautil_py;print(zoautil_py.__name__)"

    Posted Tue April 20, 2021 04:31 AM

    Hi Austin,

    I ran the "pip3 install..." command and posted the output below.
    There are two files "types.py" in the python39 subdirectory and also in the zoau subdirectory. I have set PYTHONPATH with python39 first and zoau second. setenv PYTHONPATH /usr/lpp/python/v3r9/pyz/lib/python3.9:/usr/lpp/zoau/zoautil_py/zoautil_py

    I saw that  "Check the logs for full command output" but could not find any further helpful information.


    Please suggest what to do. Thanks.

    regards
    Matthias.

    > printenv PATH

    /usr/lpp/zoau/bin:/usr/lpp/python39/bin:/bin:/sbin:/usr/local/bin

    > printenv LIBPATH

    /usr/lpp/zoau/lib:/usr/lpp/python/v3r9/pyz/lib

    > printenv PYTHON_HOME

    /usr/lpp/python39

    > printenv ZOAU_HOME

    /usr/lpp/zoau

    > python3 --version

    Python 3.9.0

     

    > zoaversion

    2020/09/25 14:07:34 CUT V1.1.0

     

    > setenv PYTHONPATH /usr/lpp/python/v3r9/pyz/lib/python3.9:/usr/lpp/zoau/zoautil_py/zoautil_py

    > python3 -m venv env

    > source env/bin/activate    (recommended shell to use might be updated in the documentation)

     

    Txxxxxx@TN01:/home/Txxxxxx ==> cd /usr/lpp/zoau

    Txxxxxx@TN01:/usr/lpp/zoau ==> ls -al

    drwxr-xr-x    2 BPXROOT  OMVSGRP     8192 Mar  9 06:34 IBM

    drwxr-xr-x    2 BPXROOT  SYS1        8192 Sep 25  2020 bin

    drwxr-xr-x    2 BPXROOT  SYS1        8192 Sep 25  2020 conf

    drwxr-xr-x    4 BPXROOT  SYS1        8192 Mar 10 16:52 docs

    drwxr-xr-x    2 BPXROOT  SYS1        8192 Sep 25  2020 include

    drwxr-xr-x    2 BPXROOT  SYS1        8192 Sep 25  2020 lib

    lrwxrwxrwx    1 BPXROOT  OMVSGRP       16 Mar  9 15:06 zoautil_py -> zoautil_py-1.1.0

    drwxr-xr-x    3 BPXROOT  OMVSGRP     8192 Jan  1  1970 zoautil_py-1.1.0

    -rwxr-xr-x    1 BPXROOT  SYS1       15856 Sep 25  2020 zoautil_py-1.1.0.tar.gz

     

    Txxxxxx@TN01:/usr/lpp/zoau ==> pip3 install zoautil_py-1.1.0.tar.gz

    Defaulting to user installation because normal site-packages is not writeable

    Processing ./zoautil_py-1.1.0.tar.gz

    Using legacy 'setup.py install' for zoautil-py, since package 'wheel' is not installed.

    Installing collected packages: zoautil-py

        Running setup.py install for zoautil-py ... error

        ERROR: Command errored out with exit status 1:

         command: /usr/lpp/python39/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/TN01/tmp/pip-req-build-7n

    68ioo6/setup.py'"'"'; __file__='"'"'/TN01/tmp/pip-req-build-7n68ioo6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file_

    _);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /TN

    01/tmp/pip-record-ojij11p7/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home

    /Txxxxxx/.local/include/python3.9/zoautil-py

             cwd: /TN01/tmp/pip-req-build-7n68ioo6/

        Complete output (38 lines):

        running install

        running build

        running build_py

        package init file 'zoautil_py/__init__.py' not found (or not a regular file)

        creating build

        creating build/lib.os390-27.00-8561-3.9

        creating build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/datasets.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/exceptions.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/jobs.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/mvscmd.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/opercmd.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/types.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/utilities.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/volumes.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        copying zoautil_py/zsystem.py -> build/lib.os390-27.00-8561-3.9/zoautil_py

        running egg_info

        creating zoautil_py.egg-info

        writing zoautil_py.egg-info/PKG-INFO

        writing dependency_links to zoautil_py.egg-info/dependency_links.txt

        writing top-level names to zoautil_py.egg-info/top_level.txt

        writing manifest file 'zoautil_py.egg-info/SOURCES.txt'

        reading manifest file 'zoautil_py.egg-info/SOURCES.txt'

        writing manifest file 'zoautil_py.egg-info/SOURCES.txt'

        creating build/lib.os390-27.00-8561-3.9/zoautil_py/src

        copying zoautil_py/src/core.c -> build/lib.os390-27.00-8561-3.9/zoautil_py/src

        running build_ext

        building 'zoautil_py.core' extension

        creating build/temp.os390-27.00-8561-3.9

        creating build/temp.os390-27.00-8561-3.9/zoautil_py

        creating build/temp.os390-27.00-8561-3.9/zoautil_py/src

        /bin/xlc -fno-strict-aliasing -DNDEBUG -O3 -qarch=10 -qlanglvl=extc99 -q64 -Wc,DLL -D_XOPEN_SOURCE_EXTENDED -D_UNIX03_THREADS -D

    _POSIX_THREADS -D_OPEN_SYS_FILE_EXT -qexportall -qascii -qstrict -qnocsect -Wa,asa,goff -Wa,xplink -qgonumber -qenum=int -I/usr/lpp/

    zoau/include/ -I/usr/lpp/zoau/lib/ -I/usr/lpp/python39/include/python3.9 -c zoautil_py/src/core.c -o build/temp.os390-27.00-8561-3.9

    /zoautil_py/src/core.o

        FSUM3212 xlc: Command option -fno-strict-aliasing is incorrect for z/OS platform - ignored.

        WARNING CCN3236 /usr/include/unistd.h:1169  Macro name _POSIX_THREADS has been redefined.

        /bin/xlc -q64 build/temp.os390-27.00-8561-3.9/zoautil_py/src/core.o -L/usr/lpp/zoau/lib/ -o build/lib.os390-27.00-8561-3.9/zoaut

    il_py/core.so -Wl,dll /usr/lpp/python39/lib/python3.9/config-3.9/libpython3.9.x -q64 /usr/lpp/zoau/lib/zoautil.x

        IKJ56228I DATA SET CEE.SCEEBND2 NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED

        FSUM3052 The data definition name SYSLIB cannot be resolved. The data set was not found. Ensure that data set name CEE.SCEEBND2

    is specified correctly.

        error: command '/bin/xlc' failed with exit code 4

        ----------------------------------------

    ERROR: Command errored out with exit status 1: /usr/lpp/python39/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0]

    = '"'"'/TN01/tmp/pip-req-build-7n68ioo6/setup.py'"'"'; __file__='"'"'/TN01/tmp/pip-req-build-7n68ioo6/setup.py'"'"';f=getattr(tokeni

    ze, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'

    exec'"'"'))' install --record /TN01/tmp/pip-record-ojij11p7/install-record.txt --single-version-externally-managed --user --prefix=

    --compile --install-headers /home/Txxxxxx/.local/include/python3.9/zoautil-py Check the logs for full command output.

    Txxxxxx@TN01:/usr/lpp/zoau ==>

     



    ------------------------------
    Matthias Rabast
    ------------------------------



  • 4.  RE: ModuleNotFoundError: No module named 'zoautil_py' when running: python3 -c "import zoautil_py;print(zoautil_py.__name__)"

    Posted Tue April 20, 2021 12:40 PM
    Hi Matthias,

    Based on the output of your compile command it looks like you have a configuration issue with your binder, either the C runtime(CEE.SCEEBND2) is missing or you do not have access to it in RACF.

    To troubleshoot you could try compiling a hello world program(in amode64 with -q64) and see if you can reproduce the symptoms.

    Thanks,
    Austin S. Wells


    ------------------------------
    Austin Wells
    ------------------------------



  • 5.  RE: ModuleNotFoundError: No module named 'zoautil_py' when running: python3 -c "import zoautil_py;print(zoautil_py.__name__)"

    Posted Tue April 27, 2021 08:00 AM

    Hello Austin,

    the SYS1.CEE.SCEEBND2 is on the system and I see no access violations; no ICH408I messages.

    When I compile a HelloWorld.c with xlc -q64 then I get the same error :

    IKJ56228I DATA SET CEE.SCEEBND2 NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED   
    See full output below.


    Can some _CXX_xxx or _C89_xxx environment variables overwrite the compile and link process?

    or is your recommendation to upgrade to zoau v1.1.1?

    or what else?

    regards,

    Matthias.


    T0xxxxx@TN01:/home/t0xxxxx ==> xlc -q64 -V HelloWorld.c

    FSUM0000I  Utility(xlc)                      Level(D191018.Z2R4)

    XL_CONFIG=/bin/../usr/lpp/cbclib/xlc/etc/xlc.cfg:xlc

    ./ ./HelloWorld.c *.c "CMDOPTS(DEFINE(errno=(*__errno())),-qoe,-qhalt=16,-qnodebug,-qlongname,-qmaxmem=*,-qmemory,-qnoexportall,-qno

    gonumber,-qtarget=le,-qnolibansi,-qlist=/dev/fd1,-qnolist,-qnooffset,-qnoxref,-qnooptimize,-qspill=128,-qexecops,-qnoexpmac,-qflag=i

    ,-qnoipa,-qstart,-qredir,-qlocale=POSIX,NOTEST,-qnolsearch,-qnomargins,-qnestinc=255,-qplist=host,-qsource=/dev/fd1,-qnosource,-qnos

    equence,-qnoshowinc,-qstart,-qterminal,-qargparse,DEFINE(_OPEN_DEFAULT=1),-qansialias,-qlanglvl=extended,-qcpluscmt,-qnoupconv,-qnoa

    lias,-qnoaggregate,-qnoinfo,-qnoevents,-qrent,-qinline=auto:noreport:100:1000,-qnoinline)" "object(./HelloWorld.o)" -q64 NOPPONLY

    STEPLIB=NONE

    _C89_ACCEPTABLE_RC=4

    -v -Wl,lp64 HelloWorld.o

    _C89_ACCEPTABLE_RC=4

    _C89_PVERSION=0x42040000

    _C89_PSYSIX=

    "_C89_L6SYSIX=CEE.SCEELIB(CELQS003)"

    _C89_L6SYSLIB=CEE.SCEEBND2:CBC.SCCNOBJ:SYS1.CSSLIB

    FSUM0000I  Utility(c89)                      Level(D190809.Z2R4)

    //* c89 ------------------------------------------------------------------------

    //LINKEDIT  EXEC  PGM=LINKEDIT,

    //  PARM='AMODE=64,TERM=YES,

    //  DYNAM=DLL,ALIASES=NO,UPCASE=NO,

    //  LIST=OFF,MAP=NO,XREF=NO,INFO=NO,MSGLEVEL=4,

    //  REUS=RENT,EDIT=YES,AC=0,CALL=YES,CASE=MIXED

    //  ,LP64'

    //SYSLIB   DD  DSN='CEE.SCEEBND2',DISP=SHR,DCB=DSORG=DIR

    //         DD  DSN='CBC.SCCNOBJ',DISP=SHR,DCB=DSORG=DIR

    //         DD  DSN='SYS1.CSSLIB',DISP=SHR,DCB=DSORG=DIR

    //C8920    DD  UNIT=3390,SPACE=(32000,(150,150)),

    //             STORCLAS=,MGMTCLAS=,DATACLAS=,DSNTYPE=,

    //             DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)

    //C8921    DD  DSN='CEE.SCEELIB(CELQS003)',DISP=SHR,DCB=DSORG=NOTDIR

    //SYSPRINT DD  PATH='/dev/fd1',

    //             PATHOPTS=(ORDWR,OCREAT,OAPPEND),FILEDATA=TEXT,

    //             PATHMODE=(SIROTH,SIRGRP,SIRUSR,SIWOTH,SIWGRP,SIWUSR)

    //SYSTERM  DD  PATH='/dev/fd2',

    //             PATHOPTS=(ORDWR,OCREAT,OAPPEND),FILEDATA=TEXT,

    //             PATHMODE=(SIROTH,SIRGRP,SIRUSR,SIWOTH,SIWGRP,SIWUSR)

    //SYSLMOD  DD  PATH='a.out',

    //             PATHOPTS=(OWRONLY,OCREAT),

    //             PATHMODE=(SIRWXO,SIRWXG,SIRWXU)

    //SYSLIN   DD  *

      INCLUDE C8920

      INCLUDE './HelloWorld.o'                                                      

      INCLUDE C8921

    /*

    IKJ56228I DATA SET CEE.SCEEBND2 NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED   

    FSUM3052 The data definition name SYSLIB cannot be resolved. The data set was not found. Ensure that data set name CEE.SCEEBND2 is s

    pecified correctly.



    ------------------------------
    Matthias Rabast
    ------------------------------