Skip to content

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

@theshoaibshafique

Description

@theshoaibshafique

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions