Forum Discussion
importing dataframe with python throws script error
- 7 years ago
Hi Anonymous jono,
Anonymous Thank you for your information. Power doesn't have the feature which can run a cmd batch file when open. As a workaround, you can install the batch as a windows service. Please refer to: https://stackoverflow.com/questions/415409/run-batch-file-as-a-windows-service.
Regards,Jimmy Tao
Hi Anonymous jono,
Anonymous Thank you for your information. Power doesn't have the feature which can run a cmd batch file when open. As a workaround, you can install the batch as a windows service. Please refer to: https://stackoverflow.com/questions/415409/run-batch-file-as-a-windows-service.
Regards,
Jimmy Tao
So I could not solve it using the service approach. Besides, it is kind of hackish. I ended up doing another straight Python install using the conventional windows installer and then pip installing the pandas package. I put this intalled version of Python in the PATH environment variable.
So I have two installations of the same versions of Python 3.7. One with Anaconda, and another by itself. Since the standalone Python does not require activation of the Conda environment, it worked fine.
I know it is sub-optimal, but it works. Power BI developers need to support different Pyenv and Conda environments in the future releases of Python support.
Bharat
- Anonymous7 years agoNot applicable
Thank you Anonymous , this worked! I only had Anaconda as well (as I'm sure many will or Anaconda/Pycharm), so this was the only suggestion that worked for me. I can't wait to have fun with Python + PowerBI !
1) As mentioned, I had to pip install Pandas (which then automatically installs numpy because of dependencies).
2) Additionally, I had to also pip install matplotlib (even though my script did not import matplotlib).