Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abort with a traceback #1

Open
MariuszXC opened this issue Jan 22, 2023 · 6 comments
Open

abort with a traceback #1

MariuszXC opened this issue Jan 22, 2023 · 6 comments

Comments

@MariuszXC
Copy link
Contributor

On Ubuntu 22.04.1 LTS, Python 3.10.6

$ python3 jsb-to-png.py jsb-test.xml 
Starting JSBSim to PNG program, version 1.08
Parsing jsb-test.xml
Output to folder /opt/fg/myHangar/jsb-to-png/jsb-test (will overwrite PNG images if exist)
Generating the (1280x720) PNG images..
Traceback (most recent call last):
  File "/opt/fg/myHangar/jsb-to-png/./jsb-to-png.py", line 87, in <module>
    fig.write_image(file+os.sep+name+".png", format='png', width=image_width, height=image_height, scale=1)
  File "/usr/lib/python3/dist-packages/plotly/basedatatypes.py", line 3821, in write_image
    return pio.write_image(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/plotly/io/_kaleido.py", line 268, in write_image
    img_data = to_image(
  File "/usr/lib/python3/dist-packages/plotly/io/_kaleido.py", line 145, in to_image
    img_bytes = scope.transform(
  File "/home/xxx/.local/lib/python3.10/site-packages/kaleido/scopes/plotly.py", line 153, in transform
    response = self._perform_transform(
  File "/home/xxx/.local/lib/python3.10/site-packages/kaleido/scopes/base.py", line 293, in _perform_transform
    self._ensure_kaleido()
  File "/home/xxx/.local/lib/python3.10/site-packages/kaleido/scopes/base.py", line 203, in _ensure_kaleido
    raise ValueError(startup_response.get("message", "Failed to start Kaleido subprocess"))
ValueError: --plotlyjs argument is not a valid URL or file path: /usr/lib/python3/dist-packages/plotly/package_data/plotly.min.js
@NikolaiVChr
Copy link
Owner

I think you are using the wrong library for plotly.

Did you try this:
image

@NikolaiVChr
Copy link
Owner

Did you do this?
pip install plotly==5.3.1

I did not use kaleido when using plotly, maybe that's the issue.

@NikolaiVChr
Copy link
Owner

It seems newer versions of plotly use kaleido. Hence why maybe try the 5.3.1, which is a version before needing kaleido.

@MariuszXC
Copy link
Contributor Author

MariuszXC commented Jan 23, 2023

I have plotly 5.4.0 installed.

$ pip3 install plotly
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: plotly in /usr/lib/python3/dist-packages (5.4.0)

Will try to downgrade.

Edit:

$ pip3 install plotly==5.3.1
Defaulting to user installation because normal site-packages is not writeable
Collecting plotly==5.3.1
  Downloading plotly-5.3.1-py2.py3-none-any.whl (23.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.9/23.9 MB 7.3 MB/s eta 0:00:00
Requirement already satisfied: tenacity>=6.2.0 in /usr/lib/python3/dist-packages (from plotly==5.3.1) (6.3.1)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from plotly==5.3.1) (1.16.0)
Installing collected packages: plotly
Successfully installed plotly-5.3.1

And the result is:

$ ./jsb-to-png.py jsb-test.xml 
Starting JSBSim to PNG program, version 1.08
Parsing jsb-test.xml
Output to folder /opt/fg/myHangar/jsb-to-png/jsb-test (will overwrite PNG images if exist)
Generating the (1280x720) PNG images..
Finished. Successfully processed 71 tables.
Ignored 1 tables (see readme on how to avoid tables being ignored).

@MariuszXC
Copy link
Contributor Author

Regarding the final message about ignoring a table, it would be nice to print a starting line number(s) of the ignored table(s).

@NikolaiVChr
Copy link
Owner

Good point, I will look into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants