'How to install Plotly in Jupyter Notebook

I am having a trouble installing the plotly package in my Jupyter notebook. I tried the method in the official website and it show as below:

$ pip install plotly==5.7.0

And it turned out to be:

File "<ipython-input-37-cd34544b05a0>", line 1
$ pip install plotly==5.7.0
^
SyntaxError: invalid syntax

I also tried:

!pip install plotly

And it is said:

Collecting plotly
 Could not fetch URL https://pypi.org/simple/plotly/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/plotly/

Can anyone help or share with me the instructions? Thanks.



Solution 1:[1]

the problem is with your proxy. You need to set the verify == False somewhere. Normally via CMD is much easier. However you can try using this on jupyter

!pip install plotly config --global http.sslVerify false

As stated in my answear below. If the line doesn't work, you have a bigger problem which is your proxy. After setting your proxy, please use this line

!pip install --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org plotly 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1