<?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: file transfer through CLI to DBFS, working manually but not in python code... in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/59352#M31372</link>
    <description>&lt;P&gt;&lt;SPAN&gt;The 127 error code indicates “command not found”,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try using the full path of the databricks command&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 03:56:21 GMT</pubDate>
    <dc:creator>feiyun0112</dc:creator>
    <dc:date>2024-02-06T03:56:21Z</dc:date>
    <item>
      <title>file transfer through CLI to DBFS, working manually but not in python code...</title>
      <link>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/55402#M30322</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I ran my code sucessfully in the past but suddenly it stopped working. I have a python code that transfer local files to DBFS location using CLI. When I run the command manually on the screen, it works but in the code, it gives me the error&amp;nbsp;&amp;nbsp;"returned non-zero exit status 127". Can anyone help me please...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the part of the code that was working fine but now it is not..&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my_cmd = "databricks fs cp "+row_file+" "+upload_dir&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_args = {"shell":True, "check":True, "capture_output":True}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;subprocess.run(my_cmd, **run_args)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and the my_cmd is this:&amp;nbsp;databricks fs cp /mnt/farm/DNAlab/WGL/Samples/Data\ Analysis/Emedgene/HPO/2302706.HPO.txt dbfs:/FileStore/LiveDataUpload/WES_HPO_Dec16/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which runs fine if I copy it and execute it on shell prompt. any idea, what could be going wrong? TIA&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2023 22:24:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/55402#M30322</guid>
      <dc:creator>pshuk</dc:creator>
      <dc:date>2023-12-17T22:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: file transfer through CLI to DBFS, working manually but not in python code...</title>
      <link>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/59350#M31370</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I tried replicating your test and it worked for me so I'm not sure what's going on without knowing more about which Runtime, python version, etc you're using. But regardless, perhaps `dbutils.fs.cp` would be an easier way of doing what you're trying to achieve? You could call it directly from a python notebook cell and not have to make `subprocess` calls.&lt;BR /&gt;&lt;BR /&gt;Details here:&amp;nbsp;&lt;A href="https://docs.databricks.com/en/dev-tools/databricks-utils.html#cp-command-dbutilsfscp" target="_blank"&gt;https://docs.databricks.com/en/dev-tools/databricks-utils.html#cp-command-dbutilsfscp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 03:41:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/59350#M31370</guid>
      <dc:creator>brockb</dc:creator>
      <dc:date>2024-02-06T03:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: file transfer through CLI to DBFS, working manually but not in python code...</title>
      <link>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/59352#M31372</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The 127 error code indicates “command not found”,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try using the full path of the databricks command&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 03:56:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/file-transfer-through-cli-to-dbfs-working-manually-but-not-in/m-p/59352#M31372</guid>
      <dc:creator>feiyun0112</dc:creator>
      <dc:date>2024-02-06T03:56:21Z</dc:date>
    </item>
  </channel>
</rss>

