<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Data Loading with Python Scripts throwing Error - 2021 in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1927014#M30205</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/308099"&gt;@drew_darke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Rico Zhou&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 03:01:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-29T03:01:04Z</dc:date>
    <item>
      <title>Data Loading with Python Scripts throwing Error - 2021</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1909142#M30057</link>
      <description>&lt;P&gt;Hey All So I'm pulling data from Statistics Canada with their API. I am using a Python Script to bring it in because there are no restraints. I will post my code block, and then the error I am getting. Thanks ahead of time to anybody that can help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*MY SCRIPT*&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;import requests, json, zipfile, zlib&lt;BR /&gt;from io import BytesIO&lt;BR /&gt;import pandas as pd&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def df_from_statscan(tableid):&lt;BR /&gt;url = f"&lt;A href="https://www150.statcan.gc.ca/t1/wds/rest/getFullTableDownloadCSV/{tableid}/en" target="_blank"&gt;https://www150.statcan.gc.ca/t1/wds/rest/getFullTableDownloadCSV/{tableid}/en&lt;/A&gt;"&lt;BR /&gt;r = requests.get(url)&lt;BR /&gt;downloadurl = json.loads(r.content)["object"]&lt;BR /&gt;r = requests.get(downloadurl)&lt;BR /&gt;if r.status_code == 200:&lt;BR /&gt;csvzipbytes = r.content&lt;BR /&gt;csvzip = zipfile.ZipFile(BytesIO(csvzipbytes))&lt;BR /&gt;csvcontent = csvzip.read(csvzip.namelist()[0])&lt;BR /&gt;df = pd.read_csv(BytesIO(csvcontent))&lt;BR /&gt;return df&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;df_from_statscan("11100106")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*****************************************&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UNABLE TO CONNECT: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;We encountered an error while trying to connect.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Details: "ADO.NET: Python script error.&lt;BR /&gt;&amp;lt;pi&amp;gt;Traceback (most recent call last):&lt;BR /&gt;File "PythonScriptWrapper.PY", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;import os, pandas, matplotlib&lt;BR /&gt;File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\matplotlib\__init__.py", line 205, in &amp;lt;module&amp;gt;&lt;BR /&gt;_check_versions()&lt;BR /&gt;File "C:\PROGRAMDATA\ANACONDA3\lib\site-packages\matplotlib\__init__.py", line 190, in _check_versions&lt;BR /&gt;from . import ft2font&lt;BR /&gt;ImportError: DLL load failed: The file cannot be accessed by the system.&lt;BR /&gt;&amp;lt;/pi&amp;gt;"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;******************************************************&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I program in Python and I am familiar with Data Science using Python but I am not recognizing these exceptions being thrown. Thanks to anybody who can help!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 13:36:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1909142#M30057</guid>
      <dc:creator>drew_darke</dc:creator>
      <dc:date>2021-06-18T13:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data Loading with Python Scripts throwing Error - 2021</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1911425#M30074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/308099"&gt;@drew_darke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which version of python did you use to connect to your data source? You install try Python 36 and try again.&lt;/P&gt;
&lt;P&gt;And please check whether the environment of your python has been configured correctly.&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts" target="_self"&gt;Run Python scripts in Power BI Desktop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Try to&amp;nbsp;&lt;STRONG&gt;start PBIDesktop from within an activated conda environment&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and have the Python home directory configured.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the Anaconda Prompt run:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;(base) C:&amp;gt; "Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you download your desktop from app store , windows 10 Apps are stored in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;C:\Program Files\WindowsApps.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;C:\Program Files\WindowsApps\Microsoft.MicrosoftPowerBIDesktop_2.75.5653.0_x64__8wekyb3d8bbwe\bin\PBIDesktop.exe&lt;/PRE&gt;
&lt;P&gt;However, the WindowsApps folder is both hidden and protected, but with admin rights you can take over ownership like described e.g. in this article:&amp;nbsp;&lt;A href="https://www.maketecheasier.com/access-windowsapps-folder-windows-10/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.maketecheasier.com/access-windowsapps-folder-windows-10/&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 07:30:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1911425#M30074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-21T07:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data Loading with Python Scripts throwing Error - 2021</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1927014#M30205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/308099"&gt;@drew_darke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Rico Zhou&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 03:01:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Data-Loading-with-Python-Scripts-throwing-Error-2021/m-p/1927014#M30205</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-29T03:01:04Z</dc:date>
    </item>
  </channel>
</rss>

