1. Error description
E:\PycharmProjects\cdk\venv\Scripts\python.exe E:/PycharmProjects/cdk/venv/plotly/b.py
Traceback (most recent call last):
File "E:/PycharmProjects/cdk/venv/plotly/b.py", line 14, in <module>
py.iplot(data,filename='Histogram');
File "E:\PycharmProjects\cdk\venv\lib\site-packages\plotly\plotly\plotly.py", line 170, in iplot
return tools.embed(url, **embed_options)
File "E:\PycharmProjects\cdk\venv\lib\site-packages\plotly\tools.py", line 404, in embed
!= session.get_session_config()['plotly_domain']):
KeyError: 'plotly_domain'
Process finished with exit code 1
2. Cause of error
import plotly;
import plotly.plotly as py;
import plotly.graph_objs as go;
plotly.tools.set_credentials_file(username='xxx',api_key='787889Pa0GMIkz1R3Z1BHy');
C = go.Bar(
x = [1,2,3,4,5,6,7,8],
y = [7889,5623,9856,1254,4878,5656,3562,7445]
)
data = [C];
py.iplot(data,filename='Histogram');
3. Solutions
When drawing graphics, you need to call the plot () method instead of the iPlot () method
import plotly;
import plotly.plotly as py;
import plotly.graph_objs as go;
plotly.tools.set_credentials_file(username='xxx',api_key='56895656GMIkz1R3Z1BHy');
C = go.Bar(
x = [1,2,3,4,5,6,7,8],
y = [7889,5623,9856,1254,4878,5656,3562,7445]
)
data = [C];
py.plot(data,filename='Histogram');
Read More:
- [Solved] Keras Error: KeyError: ‘accuracy‘, KeyError: ‘val_acc‘, KeyError: ‘acc‘
- How to Solve Vue & Django Cross-domain Issue
- [Solved] os.py“, line 725, in __getitem__ raise KeyError(key) from None KeyError: ‘PATH‘
- How to Fix Common Arcpy Error
- How to Fix the printer error 0x00000709 on Windows
- How to Fix Cannot convert value of type Error
- How to Fix Error return arrays must be of arraytype
- How to Fix “Microsoft Visual C ++ 14.0 is required” Error
- How to Fix TNS 12560 Error
- WordPress update failed 429 too many requests (How to Fix)
- How to Fix Spoolsv.exe Application Error
- How to Fix the common Warning Errors after Vue Project Startup
- How to Fix IIS7.5 Disallowed Parent Path Error
- (How to Fix) Ora-00600: internal error code, arguments: [4194]
- Start failure: spawn CMD enoent error (How to Fix)
- How to Fix NSS error 12190 in curl accessing to HTTPS
- Websocket: How to Fix Error Read Econnreset
- How to Fix “Cannot open Eclipse Marketplace” Error
- How to Fix Microsoft SQL Server Error 1326
- How to Fix Error Launching Installer WIN10