New to python. Not sure how to to add a module.
import plotly.express as px
Error:
ipdb> ModuleNotFoundError: No module named 'plotly'
What steps are need to have this module recognised?
New to python. Not sure how to to add a module.
import plotly.express as px
Error:
ipdb> ModuleNotFoundError: No module named 'plotly'
What steps are need to have this module recognised?
What worked for me, both under Windows and under MacOSX, is using Anaconda for all Python apps. This post also advises to use Anaconda:
Python dependency hell: A compromise between virtualenv and global dependencies?
I also found this article to be useful:
https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-spyder
These are the steps I took.
Install Anaconda:
https://docs.anaconda.com/anaconda/user-guide/getting-started/
Under Windows, open the Anaconda cmd prompt from the Anaconda Navigator. Under MacOSX, just open the cmd prompt.
In the cmd prompt, install plotly with this command:
conda install plotly
This installs plotly in the Anaconda environment.
Launch Spyder from the Anaconda Navigator. Always launch Spyder from the Anaconda Navigator, to make sure you're running the copy of Spyder from the Anaconda environment.
In a Python script, load plotly:
import plotly as py
After that you should be good to go with plotly.