Power BI - Importing fbprophet and using Anaconda as Default Python

Hi Guys,

The other day, I was trying to use the fbprophet package to do a Time Series Analysis using Python  through Power BI and "Smack!", I hit a roadblock. I tried installing the fbprophet packeage using

pip install fbprophet

but it threw a ton of errors. So naturally I looked around on the internet and came across quite a number of forums that confirmed there was a problem when installing fbprophet through pip on Windows 10.

One such link is

https://github.com/facebook/prophet/issues/2

While I was reading through a few more articles I found out that by using the Anaconda platform it was possible to install and implement the fbprophet package and so I tried it out and after a few struggles I managed to get it to work!

These are the steps I took,

1. Uninstalled the existing python instance/s on my machine

2. Deleted the existing application folders

3. Downloaded the graphical installer(Python version 3.7) for Anaconda from the website below

https://www.anaconda.com/distribution/

4. Executed the download package and did the following

  • Select 'just me'




  • Keep the default destination folder as it is

  • Enabled both the Advanced Option (Add Anaconda3 to my PATH environment variable and Register Anaconda3 as my default Python 3.7)

5. Install

6. Once installed, open the Anaconda3 Navigator and launch the CMD.exe Prompt (it will open up a command propt where you can install packages, list information .etc.)







7. The fbprophet package has a prerequisite which is the pystan package and therefore it needs to be installed first. To install it run the following command

conda install pystan
  • Please note that there maybe instances you need to install Microsoft Visual C++ 14.0. Follow the link below to install Visual Studio Build Tools
8. Next install the fbrpophet package

conda install -c conda-forge fbporphet

9. Open up PowerBI and click on Transform Data

10. Go to File > Options and Settings > Options and select the Python Scripting Tab and select the python directory where you installed the Anaconda3 (It is usually Detected and available in the dropdown list. Also you might see 2 with the same name. You can select either)

Now you can run your python script on Power BI and import and use the fbprophet package as well.

Here is a sample code written along with an output on Power BI





Hope this comes in handy
Cheers!









Comments

  1. Hey Nilhan, I am trying to run a prophet model on Power BI but I keep getting an error when I'm trying to start the Python script. Any suggestions when dealing with scripting errors on Power BI?
    I am using Anaconda on my local computer and the error asks me to install the mkl-service package which I have tried doing, but it does not help. Let me know how you went about running your Python script, thanks!

    ReplyDelete
  2. Microsoft Power BI is aData Analytics tool for business users, who want to analyze data quickly, easily, and accurately. Power BI is part of the Microsoft BI suite, and is one of the most user-friendly tools for data analytics in the market today. One of the main challenges when you are using a data analytics tool is finding the best data sources to analyze. In this article, I am going to show you two data sources that you can use with Power BI: first, the fbprophet Python library, which creates long-term forecasts, and second, Anaconda, which is a distribution of Python.

    ReplyDelete
  3. Thank you so much for providing such a unique and descriptive analysis of Power BI and REST API.

    Powerbi Read Rest

    ReplyDelete

Post a Comment

Popular posts from this blog

Integrating data onto Power BI from INSIGHTLY CRM

Power BI- Route Map