ebob9 / cloudgenix_serial_report

Script to generate a serial usage report for a CloudGenix Network.
MIT License
0 stars 0 forks source link

Recent Error #2

Open moorets1 opened 3 years ago

moorets1 commented 3 years ago

I was running the serial report via python and ran into this error

Building ID->Name lookup table. Querying APIs. Parsing Responses. Building Reports. Traceback (most recent call last): File "C:\CloudGenix_Python\cloudgenix_serial_report-master\serial_report.py", line 5, in cloudgenix_serial_report.go() File "C:\CloudGenix_Python\cloudgenix_serial_report-master\cloudgenix_serial_report__init.py", line 270, in go generate(sdk, specify_filename=args["output"]) File "C:\CloudGenix_Python\cloudgenix_serial_report-master\cloudgenix_serial_report__init__.py", line 189, in generate ws.column_dimensions[column].width = adjusted_width File "C:\Users\moorets1\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\utils\bound_dictionary.py", line 25, in getitem setattr(value, self.reference, key) File "C:\Users\moorets1\AppData\Local\Programs\Python\Python39\lib\site-packages\openpyxl\descriptors\base.py", line 42, in set__ raise TypeError('expected ' + str(self.expected_type)) TypeError: expected <class 'str'> PS C:\CloudGenix_Python\cloudgenix_serial_report-master>

ebob9 commented 3 years ago

I believe this is the same bug/issue as #1 - can you verify your version of openpyxl?

Since this script was released, newer versions of openpyxl have changed behavior. This script only works for sure with openpyxl 2.5.4.

If you installed via pip, can likely do pip list | grep openpyxl to see the version:

openpyxl             2.5.4

If version is different, please try installing that exact version of openpyxl - if using pip, can do pip install --upgrade openpyxl==2.5.4

Let me know if this makes it work.

moorets1 commented 3 years ago

Here is what I am using

PS C:\Users\moorets1> pip list openpyxl Package Version


certifi 2020.12.5 cffi 1.14.4 chardet 3.0.4 cloudgenix 5.4.3b1 cloudgenix-config 1.3.0b3 cloudgenix-idname 2.0.2 cryptography 3.3.1 et-xmlfile 1.0.1 fuzzywuzzy 0.18.0 idna 2.10 jdcal 1.4.1 Jinja2 2.11.2 MarkupSafe 1.1.1 numpy 1.19.5 openpyxl 3.0.6 pandas 1.2.0 Pbar 1.0 pip 21.1 progressbar 2.5 progressbar2 3.53.1 pycparser 2.20 pyOpenSSL 20.0.0 python-dateutil 2.8.1 python-utils 2.5.1 pytz 2020.5 PyYAML 5.3.1 requests 2.25.0 setuptools 49.2.1 six 1.15.0 urllib3 1.26.2 websockets 8.1

Thank You,

ebob9 commented 3 years ago
openpyxl       3.0.6

Yup - that is likely the issue.

If possible, please try downgrading openpyxl with the following command: pip install --upgrade openpyxl==2.5.4

And then run the script. It should work hopefully at that point.

When finished, you can go back to the current openpyxl version you have (if needed) with: pip install --upgrade openpyxl==3.0.6