× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ok, I'm not using QSECOFR but my user profile's home directory was "/"

I switched profiles and was able to install openpyxl without any issues.
pip3 install openpyxl.

Try to run the test script, I get these messages:

python3 /pyscripts/opnpyxl.py
Traceback (most recent call last):

File "/pyscripts/opnpyxl.py", line 1, in <module>

from openpyxl import Workbook

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/openpyxl/__init__.py",
line 6, in <module>
from openpyxl.workbook import Workbook

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/openpyxl/workbook/__init__.py",
line 4, in <module>
from .workbook import Workbook

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/openpyxl/workbook/workbook.py",
line 7, in <module>
from openpyxl.worksheet.worksheet import Worksheet

File
"/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/openpyxl/worksheet/worksheet.py",
line 396
return
f"{get_column_letter(min_col)}{min_row}:{get_column_letter(max_col)}{max_row}"


^
SyntaxError: invalid syntax




On Tue, Jan 18, 2022 at 12:13 AM John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Mon, Jan 17, 2022 at 5:00 PM Jack Tucky <jacktucky@xxxxxxxxx> wrote:

Note that the directory
/QOpenSys/pkgs/lib/python3.6/site-packages/openpyxl
is there but I can't find any openpyxl module.

I'm not sure what you mean by "can't find any openpyxl module" but my
guess is that you are looking for a file called `openpyxl.py` and not
finding it.

There isn't one. But openpyxl is indeed installed. The `__init__.py`
in the `openpyxl` directory makes that directory a "package" in Python
terminology.

From within Python, there isn't much meaningful difference between
"module" and "package". Either way, you use `import` as usual. The
true test of whether you can "find" some module or package is to try
importing it.

Now, if what you mean is that you are unable to import `openpyxl`,
then the most likely explanation is that you are using a different
Python than the one for which openpyxl is installed.

[33mWARNING: Running pip as root will break packages and permissions.
You
should install packages reliably by using venv: https:
//pip.pypa.io/warnings/venv [0m

I have two things to say about that warning. First, it's just a
warning. There may not be any hard failure. Usually, if you get a
warning while trying to install something with pip, the installation
still worked. As I said before, the true test is going into Python and
trying to import the thing you just tried to install.

The second thing is: Apparently, you're logged in as root, which
deserves a warning unto itself, apart from any issues with pip.

You should treat the root user more-or-less like you would treat
QSECOFR. You wouldn't log in as QSECOFR just to do RPG programming,
right?

So, while Jack Woehr's recommendation is a good one, I think the first
thing you should do is log in with a "normal" user profile (create one
if you don't already have one). And then if you want to dive into
virtual environments, even before trying to program anything in
Python, by all means do that; but in my opinion working with venvs can
wait.

John Y.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.