Olumide Olaoye
Olumide Olaoye

Reputation: 1

Unable to publish Jupyter Notebook to Medium

I'm trying to publish an article from a Jupyter Notebook to Medium using the jupyter_to_medium package. My jupyter notebook version is 6.1.5.

Whenever trying to uploading using the following code:

import jupyter_to_medium as jtm 

jtm.publish(r"C:\Users\user\Downloads\people_analytics_HR_attrition_rate.ipynb",
    integration_token=None,
    pub_name=None,
    title=None,
    tags=None,
    publish_status='draft',
    notify_followers=False,
    license='all-rights-reserved',
    canonical_url=None,
    chrome_path=None,
    save_markdown=False,
    table_conversion='chrome')

I keep getting this error message below:

Failed to post to Medium
Returned error message below

"JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Traceback (most recent call last):
File \"C:\\Users\\user\\anaconda3\\Lib\\site-packages\\requests\\models.py\", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"C:\\Users\\user\\anaconda3\\Lib\\json\\__init__.py\", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"C:\\Users\\user\\anaconda3\\Lib\\json\\decoder.py\", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"C:\\Users\\user\\anaconda3\\Lib\\json\\decoder.py\", line 355, in raw_decode
raise JSONDecodeError(\"Expecting value\", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File \"C:\\Users\\user\\anaconda3\\Lib\\site-packages\\jupyter_to_medium\\_bundler.py\", line 37, in upload
data = publish(**kwargs)
^^^^^^^^^^^^^^^^^
File \"C:\\Users\\user\\anaconda3\\Lib\\site-packages\\jupyter_to_medium\\_publish_to_medium.py\", line 300, in publish
p.main()
File \"C:\\Users\\user\\anaconda3\\Lib\\site-packages\\jupyter_to_medium\\_publish_to_medium.py\", line 216, in main
self.author_id = self.get_author_id()
^^^^^^^^^^^^^^^^^^^^
File \"C:\\Users\\user\\anaconda3\\Lib\\site-packages\\jupyter_to_medium\\_publish_to_medium.py\", line 96, in get_author_id
return r.json()['data']['id']
^^^^^^^^
File \"C:\\Users\\user\\anaconda3\\Lib\\site-packages\\requests\\models.py\", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Image of Error Received

I have followed the steps in the article here https://pypi.org/project/jupyter-to-medium/ and have my integration token in the home directory.

Upvotes: 0

Views: 38

Answers (0)

Related Questions