Black Lives Matter. Please consider donating to Black Girls Code today.
https://www.blackgirlscode.com

Py.plot returns error expecting plot.ly instead of plotly.com

Since the change on March 24th, I get an error when calling chart_studio.plotly.plotly.iplot.

Because you didn’t supply a ‘file_id’ in the call, we’re assuming you’re trying to snag a figure from a url. You supplied the url, ‘https://plotly.com/~darkruby501/93/accounts-created-5-posts-viewed/’, we expected it to start with ‘https://plot.ly’.
Run help on this function for more information.

However, in my unaltered function call, I don’t supply an URL, just a title.

            py.iplot(fig, filename=title)

The library must be doing the appending of the URL and have not been updated. I believe I’m on the latest version. ChartStudio 1.1.0

Oddly, the call seems to succeed despite returning the error.

Hi @darkruby501,

Welcome to Plotly forum!
The displayed error has its origin here:
https://github.com/plotly/plotly.py/blob/master/packages/python/chart-studio/chart_studio/plotly/plotly.py#L482

Recently the plotly url changed from https://plot.ly to https://plotly.com.

Running in my notebook the following line it is obvious that somewhere the url is unchanged in version 4.6:
plotly

Feel free to open an issue in plotly.py: https://github.com/plotly/plotly.py/issues.

Fantastic! That helped me solve the problem. Just needed to update my config file. I guess the config file wasn’t modified upon upgrade.

Hey, can you explain how you update the config file?
I have no clue what that means.

Hi @swishan,

Somewhere on your machine (depending on OS) there is a file .config within a folder .plotly . Open the file .config with a text editor.
Now it looks as follows:

{
    "plotly_streaming_domain": "stream.plot.ly",
    "world_readable": true,
    "plotly_proxy_authorization": false,
    "plotly_domain": "https://plot.ly",
    "plotly_ssl_verification": true,
    "plotly_api_domain": "https://api.plot.ly",
    "sharing": "public",
    "auto_open": true
}

Change the line
"plotly_domain": "https://plot.ly",
to:
"plotly_domain": "https://plotly.com",
and save it.

The easiest way to set your config values from Python is to execute this code one time:

from chart_studio.tools import set_config_file
set_config_file(plotly_domain="https://plotly.com", plotly_api_domain="https://api.plotly.com")