ImportError: No module named 'xlsxwriter' when calling python script from RPGLE program but same script is running in interactively in STRQSH and QP2TERM
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)
-
reporter -
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).
-
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
- Passed the following from QP2TERM to avoid junk charaters junk character issue in QP2term
rm $HOME/.profile echo 'PATH=/QOpenSys/pkgs/bin:$PATH' >> $HOME/.profile echo 'export PATH' >> $HOME/.profile
Now situation -
- 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 .
-
reporter Pl advise
-
It looks like there’s still two pending issues.
- Your
.profile
still has junk. I suspect you need to delete it, dotouch -C 1208
and then edit it with an editor to put in the appropriate contents. 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')
- Your
-
reporter I am able to run script from CL now.
Junk characters issue still not resolved.
i did
touch -C 1208
. -
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++?
-
- changed status to resolved
Closing due to lack of feedback
- Log in to comment
Pl advise if i need to share more info here.