ImportError: No module named 'xlsxwriter' when calling python script from RPGLE program but same script is running in interactively in STRQSH and QP2TERM

Issue #139 resolved
kapil tiwari created an issue

ImportError: No module named 'xlsxwriter' when calling python script from RPGLE program but same script is running in interactively in STRQSH and QP2TERM

Comments (8)

  1. Jesse G

    Did you install xlsxwriter globally or on a per-user basis with --user? If so, make sure you’re running the same user.

    I suspect, however, that the two environments are running different versions of Python. Try fully-qualifying the python command as /QOpenSys/pkgs/bin/python3 in both environments and report the results.

    You may want to verify that the 5733OPS product is not installed (assuming you have no production code using it).

  2. kapil tiwari reporter

    • I have removed 5733OPS  from system.
    • i have re-installed open source from ACS (Open source Package Management)
    • I set path path
    echo 'PATH=/QOpenSys/pkgs/bin:$PATH' >> $HOME/.profile
    echo 'export PATH' >> $HOME/.profile
    
    • Now i did pass below command from STRQSH
    mv .profile .profile2
    touch -C 819 .profile
    cat .profile2 > .profile
    
    rm $HOME/.profile
    echo 'PATH=/QOpenSys/pkgs/bin:$PATH' >> $HOME/.profile
    echo 'export PATH' >> $HOME/.profile
    

    Now situation -

    1. still junk characters in QP2TERM,
                                                           /QOpenSys/usr/bin/-sh                                        
    
       /QOpenSys/etc/profile: ×ÁãÈ~aØÖ^×^Å^Õ⨢a^×^Ò^Ç¢a^Â^É^Õz[×ÁãÈ%:  not found.                                      
       $                                                                                                                
     > which python3                                                                                                    
       /QOpenSys/pkgs/bin/python3                                                                                       
       $                                                                                                                
    

    2. no refererence is coming out after passing “which python3” in STRQSH but coming in QP2TERM

    which python3
    which: 0652-141 There is no python3 in /QOpenSys/usr/bin /usr/ccs/bin /QOpenSys/usr/bin/X11 /usr/sbin . /usr/bin.
    \$

    3. original issue still there “ no module error “ when calling from CL

    4.

    Pl advise .

  3. Jesse G

    It looks like there’s still two pending issues.

    1. Your .profile still has junk. I suspect you need to delete it, do touch -C 1208 and then edit it with an editor to put in the appropriate contents.
    2. python3 not being found from QSH (because of #1)

    Regardless, if you fully-qualify the command, you should be able to get the correct Python from the CL. That is, your CL would be something like QSH CMD('cd /home/me/myapp && /QOpenSys/pkgs/bin/python3 app.py')

  4. kapil tiwari reporter

    I am able to run script from CL now.

    Junk characters issue still not resolved.

    i did  touch -C 1208.

  5. Jesse G

    Do you have a mapped drive to the IBM i system? If so, can you open the file up in an editor such as Notepad++?

  6. Log in to comment