<?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>question Re: Impala-shell encounters ImportError when pwd contains python file whose name conflict with modul in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55600#M62547</link>
    <description>I am not a python expert here but I believe this is intended behavior as the import itself will look in the working directory prior to checking Python home, etc.&lt;BR /&gt;&lt;BR /&gt;Yep confirmed in the Python docs. Well it is Python 3; should still be correct for Python 2.6 or 2.7.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.python.org/3/tutorial/modules.html#the-module-search-path" target="_blank"&gt;https://docs.python.org/3/tutorial/modules.html#the-module-search-path&lt;/A&gt;</description>
    <pubDate>Fri, 09 Jun 2017 02:43:38 GMT</pubDate>
    <dc:creator>mbigelow</dc:creator>
    <dc:date>2017-06-09T02:43:38Z</dc:date>
    <item>
      <title>Impala-shell encounters ImportError when pwd contains python file whose name conflict with module</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55539#M62546</link>
      <description>&lt;P&gt;When we execute impala-shell command at a directory contains user defined python script, and the script name conflicts with python module imported by impala-shell, we will encounter an Import Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to reproduce:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;create abc.py&lt;PRE&gt;$ touch abc.py&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;execute impala-shell:&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;$ impala-shell
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "/usr/lib/impala-shell/impala_shell.py", line 24, in &amp;lt;module&amp;gt;
import getpass
File "/usr/lib64/python2.6/getpass.py", line 18, in &amp;lt;module&amp;gt;
import os, sys, warnings
File "/usr/lib64/python2.6/os.py", line 398, in &amp;lt;module&amp;gt;
import UserDict
File "/usr/lib64/python2.6/UserDict.py", line 82, in &amp;lt;module&amp;gt;
import _abcoll
File "/usr/lib64/python2.6/_abcoll.py", line 11, in &amp;lt;module&amp;gt;
from abc import ABCMeta, abstractmethod
ImportError: cannot import name ABCMeta&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:43:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55539#M62546</guid>
      <dc:creator>linhao</dc:creator>
      <dc:date>2022-09-16T11:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Impala-shell encounters ImportError when pwd contains python file whose name conflict with modul</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55600#M62547</link>
      <description>I am not a python expert here but I believe this is intended behavior as the import itself will look in the working directory prior to checking Python home, etc.&lt;BR /&gt;&lt;BR /&gt;Yep confirmed in the Python docs. Well it is Python 3; should still be correct for Python 2.6 or 2.7.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.python.org/3/tutorial/modules.html#the-module-search-path" target="_blank"&gt;https://docs.python.org/3/tutorial/modules.html#the-module-search-path&lt;/A&gt;</description>
      <pubDate>Fri, 09 Jun 2017 02:43:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55600#M62547</guid>
      <dc:creator>mbigelow</dc:creator>
      <dc:date>2017-06-09T02:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Impala-shell encounters ImportError when pwd contains python file whose name conflict with modul</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55601#M62548</link>
      <description>Better question: why are you putting python udfs in /usr/bin or /opt/cloudera/parcels/CDH/lib/impala-shell/?</description>
      <pubDate>Fri, 09 Jun 2017 02:44:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55601#M62548</guid>
      <dc:creator>mbigelow</dc:creator>
      <dc:date>2017-06-09T02:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Impala-shell encounters ImportError when pwd contains python file whose name conflict with modul</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55606#M62549</link>
      <description>&lt;P&gt;Not putting python script under /usr/bin, but my working directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, If someone else I don't known who write a python script under home directory:&lt;/P&gt;&lt;PRE&gt;[~]$ cat abc.py
#!/usr/bin/python&lt;BR /&gt;print "test script"&lt;/PRE&gt;&lt;P&gt;Now I cannot execute impala-shell anymore due to Import Error:&lt;/P&gt;&lt;PRE&gt;[~]$ impala-shell
test script
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/usr/lib/impala-shell/impala_shell.py", line 24, in &amp;lt;module&amp;gt;
    import getpass
  File "/usr/lib64/python2.6/getpass.py", line 18, in &amp;lt;module&amp;gt;
    import os, sys, warnings
  File "/usr/lib64/python2.6/os.py", line 398, in &amp;lt;module&amp;gt;
    import UserDict
  File "/usr/lib64/python2.6/UserDict.py", line 82, in &amp;lt;module&amp;gt;
    import _abcoll
  File "/usr/lib64/python2.6/_abcoll.py", line 11, in &amp;lt;module&amp;gt;
    from abc import ABCMeta, abstractmethod
ImportError: cannot import name ABCMeta&lt;/PRE&gt;&lt;P&gt;I think&amp;nbsp;impala-shell shall not include current directory in PYTHONPATH to avoid such error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 03:57:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55606#M62549</guid>
      <dc:creator>linhao</dc:creator>
      <dc:date>2017-06-09T03:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Impala-shell encounters ImportError when pwd contains python file whose name conflict with modul</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55727#M62550</link>
      <description>It is by design. The impala-shell scripts calls out that it will look in the current working directory.&lt;BR /&gt;&lt;BR /&gt;Either workaround it or submit a request or submit your change back to the Apache Impala project.</description>
      <pubDate>Mon, 12 Jun 2017 17:20:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-shell-encounters-ImportError-when-pwd-contains-python/m-p/55727#M62550</guid>
      <dc:creator>mbigelow</dc:creator>
      <dc:date>2017-06-12T17:20:59Z</dc:date>
    </item>
  </channel>
</rss>

