Forum Discussion
Error with SEABORN
Hi,
I am getting error when trying to import seaborn and work with it.
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
x = np.random.rand(80) - 0.5
y = x+np.random.rand(80)
z = x+np.random.rand(80)
df = pd.DataFrame({'x':x, 'y':y, 'z':z})
sns.lmplot( x='x', y='y', data=df, fit_reg=False, hue='x', legend=False, palette="Blues")
import numpy as np
import pandas as pd
x = np.random.rand(80) - 0.5
y = x+np.random.rand(80)
z = x+np.random.rand(80)
df = pd.DataFrame({'x':x, 'y':y, 'z':z})
plt.show()
Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 16, in <module>
import seaborn as sns
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\seaborn\__init__.py", line 6, in <module>
from .rcmod import *
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\seaborn\rcmod.py", line 5, in <module>
from . import palettes, _orig_rc_params
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\seaborn\palettes.py", line 12, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\seaborn\utils.py", line 7, in <module>
from scipy import stats
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\stats\__init__.py", line 345, in <module>
from .stats import *
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\stats\stats.py", line 169, in <module>
import scipy.special as special
File "C:\Users\paeres\AppData\Local\Continuum\anaconda3\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
10 Replies
- v-piga-msftResident Rockstar
Hi shmat ,
By my tests and research, your issue may be caused by that you didn't install the package seaborn.
You need install the package seaborn with command like below.
Then use your script in Power BI Desktop, you could get the output.
Best Regards,
Cherry
- shmatRegular Visitor
Hi Cherry,
Thank you for your swift reply. Seaborn package has been installed before and, to be on the safe side, I did it again now.
This, however, did not solve my problem. I am still getting the same error.
Could there be anything else I am doing wrong? Maybe some other updates are needed?
In fact, the error is coming from "import seaborn as sns". If I run simply "import matplotlib.pyplot as plt" it says:
I do not get why seaborn does not work...
- v-piga-msftResident Rockstar
Hi shmat ,
Please check if you have installed the latest version of Power BI Desktop (2.69.5467.1751).
In addition, please have a test with the pbix attached which run Seaborn well in your environment.
Best Regards,
Cherry
- RomanSkFrequent Visitor
shmat - Have you solved the problem? I have the same issue.
- RomanSkFrequent Visitor
I solved it this way. I changed home directory from C:\python to C:\Program Files\Python37 in options - Python scripting and it works.
- CIDUHNew Member
Hi, how were you able to use pythin in Power BI desktop?
In Tableau I can use custom quesry as SQL, is it possible in Power BI?