Plotly in Jupyter issue

前端 未结 9 2312
暗喜
暗喜 2021-02-13 03:47

I installed plotly.py to work some plots using Jupyter but I cannot import it.

! pip install plotly --upgrade
Requirement already up-to-date: plotly in c:\\pytho         


        
相关标签:
9条回答
  • 2021-02-13 03:52

    To import seaborn, sklearn and plotly on jupyter notebook first run this on terminal for python "pip install ipykernel", for anaconda "conda install ipykernel" or "python -m ipykernel install"

    0 讨论(0)
  • 2021-02-13 03:59

    Running following on command prompt solved my issue.

    conda install -c https://conda.anaconda.org/plotly plotly
    

    It is likely that the plotly installed via pip install is somehow not detected by Jupter.

    0 讨论(0)
  • 2021-02-13 04:00

    ! pip install plotly --upgrade fix the error in my error but pip install plotly from cmd in anaconda did not help

    0 讨论(0)
  • 2021-02-13 04:01

    Install the cufflinks library along with the plotly.

    pip install plotly
    pip install cufflinks
    

    This solved the plotly no module error on the Jupyter notebook.

    0 讨论(0)
  • 2021-02-13 04:02

    After a while searching about this problem, I discovered it is a broken conda-kernel trough jupyter notebook.

    Inside your notebook check if it is pointing to the write python executable's envinronment path by:

    import sys
    sys.executable 
    
    # >>>> 'C:\\Users\\username\\AppData\\Local\\Continuum\\anaconda3\\envs\\**wrong_env**\\python.exe'
    

    If it isn't, the simple solution is to install nb_conda:

    conda install nb_conda
    
    0 讨论(0)
  • 2021-02-13 04:03

    In the jupyter notebook, running the correct kernel you want the package to be installed, run

    import sys
    !conda install --yes --prefix {sys.prefix} plotly
    

    This installs plotly within the correct kernel.

    0 讨论(0)
提交回复
热议问题