f



AttributeError: 'module' object has no attribute '__path__'

I am using Jupyter notebooks, with Python 3.4. The error below references t=
he Anaconda distribution package. This error occurred quite precipitously (=
only 2 minutes before I was able to import the modules). I am using Windows=
 7. My path in the console uses Python27. I also have python 34 as well. I =
am not sure where to start modifying the path and fear that I will break my=
 initial setup. I welcome feedback on next steps.


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
C:\Program Files\New\lib\importlib\_bootstrap.py in _find_and_load_unlocked=
(name, import_)

AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-4-0ed85c3e8b64> in <module>()
      8 import fnmatch
      9 # import xml.etree.cElementTree as ElementTree
---> 10 from xml.etree.ElementTree import XMLParser
     11 import xml.etree.ElementTree as ElementTree
     12 import glob

ImportError: No module named 'xml.etree'; 'xml' is not a package
0
kbtyo
8/31/2015 7:29:40 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

5 Replies
929 Views

Similar Articles

[PageSpeed] 55

Check and see if you have a file in your working directory with the
very same name as a module you are trying to import, or the_same_name.py
If so, change the name of that file to something else.

Laura

0
Laura
8/31/2015 8:17:16 PM
--e89a8f3bb055a4a9c7051ea1bc7d
Content-Type: text/plain; charset=UTF-8

Laura,

It does not appear to be the case. I actually had to actually unset the
PYTHONPATH.

Thanks for your suggestion.

Sincerely,
Saran

On Mon, Aug 31, 2015 at 4:17 PM, Laura Creighton <lac@openend.se> wrote:

> Check and see if you have a file in your working directory with the
> very same name as a module you are trying to import, or the_same_name.py
> If so, change the name of that file to something else.
>
> Laura
>
>

--e89a8f3bb055a4a9c7051ea1bc7d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Laura,<div><br></div><div>It does not appear to be the cas=
e. I actually had to actually unset the PYTHONPATH.=C2=A0</div><div><br></d=
iv><div>Thanks for your suggestion.</div><div><br></div><div>Sincerely,</di=
v><div>Saran</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_=
quote">On Mon, Aug 31, 2015 at 4:17 PM, Laura Creighton <span dir=3D"ltr">&=
lt;<a href=3D"mailto:lac@openend.se" target=3D"_blank">lac@openend.se</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">Check and see if you hav=
e a file in your working directory with the<br>
very same name as a module you are trying to import, or the_same_name.py<br=
>
If so, change the name of that file to something else.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Laura<br>
<br>
</font></span></blockquote></div><br></div>

--e89a8f3bb055a4a9c7051ea1bc7d--
0
Saran
8/31/2015 9:01:07 PM
In a message of Mon, 31 Aug 2015 17:01:07 -0400, Saran Ahluwalia writes:
>Laura,
>
>It does not appear to be the case. I actually had to actually unset the
>PYTHONPATH.
>
>Thanks for your suggestion.
>
>Sincerely,
>Saran

Are you and  kbtyo <ahlusar.ahluwalia@gmail.com> the same person?
If deleting your PYTHONPATH fixed it, then somewhere in that PATH
if not your current working directory, you have a different file
that shadowed something you are trying to import.

Can you make the effort to move your cursor to the bottom of
the mail you are replying to, before you start typing,
so that your reply comes after what was said before, instead of
first thing, and thus before what was said before.

Laura
0
Laura
8/31/2015 10:15:36 PM
On Tuesday, September 1, 2015 at 3:46:15 AM UTC+5:30, Laura Creighton wrote:
> Can you make the effort to move your cursor to the bottom of
> the mail you are replying to, before you start typing,
> so that your reply comes after what was said before, instead of
> first thing, and thus before what was said before.

In gmail its trivially simple but not all that obvious:
There are 3 tiny little dots below which conceal the earlier context.
You have to click that to open it. And then start entering below that

[Thanks to ChrisA I now know you can also Ctrl-A to open it.
Where does Chris find out such arcana I wonder?!]
0
Rustom
9/1/2015 3:32:46 AM
On Tue, Sep 1, 2015 at 1:32 PM, Rustom Mody <rustompmody@gmail.com> wrote:
> On Tuesday, September 1, 2015 at 3:46:15 AM UTC+5:30, Laura Creighton wrote:
>> Can you make the effort to move your cursor to the bottom of
>> the mail you are replying to, before you start typing,
>> so that your reply comes after what was said before, instead of
>> first thing, and thus before what was said before.
>
> In gmail its trivially simple but not all that obvious:
> There are 3 tiny little dots below which conceal the earlier context.
> You have to click that to open it. And then start entering below that
>
> [Thanks to ChrisA I now know you can also Ctrl-A to open it.
> Where does Chris find out such arcana I wonder?!]

It was an accident! (I'm sorry, Anna!) I use Gmail too, and one day I
happened to hit Ctrl-A. Since then, I've used it fairly often.

ChrisA
0
Chris
9/1/2015 4:07:37 AM
Reply:

Similar Artilces:

PyKota, Python: AttributeError: 'module' object has no attribute '_quote'
Hello everyone, I'm new to linux/suse, but I was given the task to install the print accounting software PyKota. Before that I never even touched a linux system, so I don't have any basic knowlegde at all! Up to now I was able to solve all problems with the help of google, but now I'm stuck. My problem: linux-6n5c:/usr/local/bin # pkusers --add john paul Creation... ERROR: PyKota v1.26_official ERROR: pkusers failed ERROR: Traceback (most recent call last): ERROR: File "/usr/local/bin/pkusers", line 442, in <module> ERROR: retco...

python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'
Hello. Has anybody already meet the problem like this? - AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run scrapy, I get File "/usr/local/lib/python2.7/site-packages/scrapy/selector/factories.py", line 14, in <module> libxml2.HTML_PARSE_NOERROR + \ AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run python -c 'import libxml2; libxml2.HTML_PARSE_RECOVER' I get Traceback (most recent call last): File "<string>", line 1, in <module...

AttributeError: 'module' object has no attribute 'HTTPSHandler'
Hi I built and installed python 2.5 from source and when I do this: opener = urllib2.build_opener(SmartRedirectHandler(), DefaultErrorHandler(), urllib2.HTTPSHandler()) I get this error. AttributeError: 'module' object has no attribute 'HTTPSHandler' What should I do? ...

AttributeError: 'module' object has no attribute 'pack'
Dear List, I have a freshly installed opensuse 11.2 and I am experiencing the following problem with the module "subprocess": sampsa@linux-912g:~> python Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/subprocess.py", line 404, in <module> import p...

AttributeError: 'module' object has no attribute 'fork'
Hi, Code: import os, time def child(pipeout): zzz = 0 while True: time.sleep(zzz) msg = ('Spam %03d' % zzz).encode() os.write(pipeout, msg) zzz = (zzz+1) % 5 def parent(): pipein, pipeout = os.pipe() if os.fork() == 0: child(pipeout) else: while True: line = os.read(pipein, 32) print('Parent %d got [%s] at %s' % (os.getpid(), line, time.time())) parent() Output: Traceback (most recent call last): File "C:/Python34/pipe1.py", line 17, in <module>...

AttributeError: 'module' object has no attribute 'logger'
hi all, when installing sage, there is a problem with emacs.py so, this screen appeared after rynning ./sage ---------------------------------------------------------------------- | Sage Version 4.4.2, Release Date: 2010-05-19 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/zid/sage/local/bin/sage-ipython", line 18, in <module> import IPython File "/usr/lib/python2.7/dist-packages/IPython/__init__.py&qu...

AttributeError: 'module' object has no attribute 'setdefaulttimeout'
I get those errors when I run: /usr/local/bin/SquidClamAV_Redirector.py -c /etc/squid/SquidClamAV_Redirector.conf ################## Traceback (most recent call last): File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ? redirector = SquidClamAV_Redirector(config) File "/usr/local/bin/SquidClamAV_Redirector.py", line 145, in __init__ self.__start_urlhandler__() File "/usr/local/bin/SquidClamAV_Redirector.py", line 454, in __start_urlhandler__ urllib.socket.setdefaulttimeout(self.timeout) AttributeError: 'module' object has no ...

AttributeError: 'module' object has no attribute 'urlopen'
Hey, I am trying to run the following example from diveintopython import urllib sock = urllib.urlopen("http://diveintopython.org/") htmlSource = sock.read() sock.close() print htmlSource I have Python 2.3.3 but when i run the above code I get the following error: raceback (most recent call last): File "urllib.py", line 1, in ? import urllib File "/home/shalen/programming/python/tutorials/py/urllib.py", line 2, in ? sock = urllib.urlopen("http://diveintopython.org/") AttributeError: 'module' object has no attribute 'urlopen'...

AttributeError: 'module' object has no attribute 'letters'
what does this error mean? i am trying to use mark hammonds win32 package. Traceback (most recent call last): File "aui2.py", line 11, in <module> import win32com.client File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 12, in <module> import dynamic, gencache, pythoncom File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 24, in <module> import build File "C:\Python25\lib\site-packages\win32com\client\build.py", line 507, in <module> valid_identifier_chars = string.le...

AttributeError: ' ' object has no attribute ' '
I am using Ubuntu 12.10, and Python 2.7.3, GNU Radio Companion v3.6.3. I get the this error in terminal: in __init__ self.wxgui_waterfallsink2_0.set_callback(wxgui_waterfallsink2_0_callback) File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in __getattr__ return getattr(self._hb, name) AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' I have been getting this error in multiple programs. So what is stopping the program here? There is no Attribute .set_callback obviously. But where is t...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y&qu...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

logging: AttributeError: 'module' object has no attribute 'getLogger'
Hi all: Being completely new to Python still (just about a week into it now) I tried to follow the Python 2.6.5 version documemtation aiming at setting up a logger as follows: <code> import logging global gPIBLogger class PIBLogger(object): ''' TODO: classdocs ''' def __init__(self, logFileName): ''' Constructor ''' self.logFileName = logFileName self.logger = logging.getLogger('PIBLogger') self.logger.setLevel(logging.DEBUG) hand...

AttributeError: 'Attributes' object has no attribute 'saveFile'
Not sure how to explain, but I'll try my best. I'm making a GUI with wxGlade. The GUI has windows that open when the "Next Page" button is pushed; the button also pickles the information that is input into the frame at the same time. The saveFile name is autocreated based on the data entered by the user in the first frame. Each frame that is created is a new class, e.g. the first frame that opens is "CharInfo", which opens the frame "Attributes". The pickling works for the first frame but doesn't work for the ones after. Apparently the saveFile at...

Web resources about - AttributeError: 'module' object has no attribute '__path__' - comp.lang.python

Resources last updated: 1/25/2016 7:07:51 AM