Reputation: 181
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:\python34\lib\site-packages
Requirement already up-to-date: requests in c:\python34\lib\site-packages (from plotly)
Requirement already up-to-date: six in c:\python34\lib\site-packages (from plotly)
Requirement already up-to-date: pytz in c:\python34\lib\site-packages (from plotly)
Cleaning up...
and then
import plotly
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-6-c27a4132ad2e> in <module>()
----> 1 import plotly
ImportError: No module named 'plotly'
I'm running Python 3.4.1, so as Jupyter, and the thing that I cannot get is that plotly works just fine when I'm running Python from the command line. Any suggestions? (I really don't want to clean install Python)
Upvotes: 18
Views: 45417
Reputation: 1
conda install -c https://conda.anaconda.org/plotly plotly
this code solved the problem. I executed this code in anaconda prompt.
Upvotes: 0
Reputation: 11
`pip install plotly. this problem usually occurs on cloud anaconda navigator when you need to plot a Plotly graph in a python program here is the solution.I suggest simply run these commands on window prompt or on git bash
Upvotes: 1
Reputation: 142
I found the solution by going through the directories. pip install is installing in default python lib folder, a more in-depth answer is here.
https://stackoverflow.com/a/48774224/9176740
Upvotes: 2
Reputation: 746
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.
Upvotes: 22
Reputation: 1
! pip install plotly --upgrade fix the error in my error but pip install plotly from cmd in anaconda did not help
Upvotes: 0
Reputation: 166
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.
Upvotes: 0
Reputation: 3690
probably it is a venv issue. Try starting jupyternotebook as follows and install plotly from whithin which will ensure that you are running jupyter from your environment.
python -m jupyter notebook
Upvotes: 0
Reputation: 430
Using plotly.plotly creates errors with different versions of python.
ensure you don't have multiple version of python installed and in your environment variables path.
Try from now to work with 'chart-studio'.
Run
'pip install chart-studio'
and then import using:
'import chart_studio.plotly as py'
Upvotes: 1
Reputation: 31
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"
Upvotes: 0
Reputation: 1409
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
Upvotes: -1
Reputation: 31
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.
Upvotes: 3