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

Got "SyntaxError: not a PNG" file when deploying through python #80

Open
theshoaibshafique opened this issue Sep 24, 2023 · 0 comments
Open

Comments

@theshoaibshafique
Copy link

Traceback (most recent call last):

File ~\AppData\Roaming\Python\Python310\site-packages\IPython\core\interactiveshell.py:3526 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

Cell In[3], line 2
jtm.publish('loc and iloc.ipynb',

File ~\AppData\Roaming\Python\Python310\site-packages\jupyter_to_medium_publish_to_medium.py:449 in publish
p.main()

File ~\AppData\Roaming\Python\Python310\site-packages\jupyter_to_medium_publish_to_medium.py:309 in main
self.md, self.image_data_dict = self.create_markdown()

File ~\AppData\Roaming\Python\Python310\site-packages\jupyter_to_medium_publish_to_medium.py:165 in create_markdown
no_ex_pp.preprocess(self.nb, self.resources)

File ~\AppData\Roaming\Python\Python310\site-packages\nbconvert\preprocessors\base.py:70 in preprocess
nb.cells[index], resources = self.preprocess_cell(cell, resources, index)

File ~\AppData\Roaming\Python\Python310\site-packages\jupyter_to_medium_preprocesors.py:204 in preprocess_cell
output["data"] = {"image/png": converter(html)}

File ~\AppData\Roaming\Python\Python310\site-packages\jupyter_to_medium_screenshot.py:182 in run
img = self.take_screenshot()

File ~\AppData\Roaming\Python\Python310\site-packages\jupyter_to_medium_screenshot.py:132 in take_screenshot
img = mimage.imread(buffer)

File ~\AppData\Roaming\Python\Python310\site-packages\matplotlib\image.py:1525 in imread
PNG images are returned as float arrays (0-1). All other formats are

File ~\AppData\Roaming\Python\Python310\site-packages\PIL\ImageFile.py:117 in init
self._open()

File ~\AppData\Roaming\Python\Python310\site-packages\PIL\PngImagePlugin.py:705 in _open
raise SyntaxError(msg)

File
SyntaxError: not a PNG file

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

1 participant