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

905 views
Skip to first unread message

Pablo Loren-Aguilar

unread,
Oct 12, 2017, 8:14:57 AM10/12/17
to Dedalus Users

Dear all:

I am trying to do my first example run with dedalus (lane_embden example), and when I execute using "python  lane_embden.py" I get the following error:

  Traceback (most recent call last):
  File "lane_emden.py", line 5, in <module>
    from dedalus import public as de
  File "/home/pablo/Research/Codes/dedalus/src/dedalus/dedalus/public.py", line 7, in <module>
    from .tools import logging as logging_setup
  File "/home/pablo/Research/Codes/dedalus/src/dedalus/dedalus/tools/logging.py", line 26, in <module>
    rootlogger = logging.root
AttributeError: 'module' object has no attribute 'root'

I am new to python, so I am completely lost. Could you guys give me some hint?

Thanks a lot and kind regards,

Pablo


Keaton Burns

unread,
Oct 12, 2017, 8:25:23 AM10/12/17
to dedalu...@googlegroups.com
Hi Pablo,

Do you know what version of python you’re running?  You can check with “python --version”.  Dedalus requires Python 3, which is normally invoked from the command line as “python3”, but it’s possible that just “python” is linked to “python3” on your system.

Also which set of instructions did you follow when installing Dedalus?

Best,
-Keaton
--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To post to this group, send email to dedalu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/9139a6f5-1105-4d9e-889b-792ba3bad8bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pablo Loren-Aguilar

unread,
Oct 12, 2017, 12:01:59 PM10/12/17
to Dedalus Users

Dear Keaton:

In order to install, I just run the provided "install.sh". 

Regarding the python version, you were right, I was using python2.7. Using python3 makes a difference. The previous error is gone. Now it is complaining about:

File "lane_emden.py", line 5, in <module>
    from dedalus import public as de
ImportError: bad magic number in 'dedalus': b'\x03\xf3\r\n'

As far as I have been able to find out, this could be caused by a conflict between python versions?. So I will make sure I use python3 for everthing. Let's see how far I can get :-)

Thanks a lot!

Pablo

Jeffrey S. Oishi

unread,
Oct 12, 2017, 12:39:41 PM10/12/17
to Dedalus Users
Hi Pablo,

Did you run the activate script before running dedalus? You need to do

$ source path/to/dedalus/bin/activate

before doing 

$ python3 script.py 

If you used the install script.

Jeff

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To post to this group, send email to dedalu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages