Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'oommftools' has no attribute 'main' #17

Open
deparkes opened this issue May 29, 2017 · 11 comments
Open

AttributeError: module 'oommftools' has no attribute 'main' #17

deparkes opened this issue May 29, 2017 · 11 comments

Comments

@deparkes
Copy link
Owner

E.g. debug, info, error etc.

@mone20chss
Copy link

Hi. I have install oommftools in my laptop, but when I try to load the oommftools main window with
python -m oommftools
then there comes this message: Traceback (most recent call last):
File "C:\Users\monic\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\monic\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\monic\AppData\Local\Programs\Python\Python37\lib\site-packages\oommftools_main
.py", line 3, in
oommftools.main()
AttributeError: module 'oommftools' has no attribute 'main'

Can you help me to solve this problem?

@deparkes
Copy link
Owner Author

Hi, Could I check how you installed oommftools?

@mone20chss
Copy link

I wrote: pip install oommftools in the cmd of windows. So it started to installing.

@deparkes
Copy link
Owner Author

deparkes commented May 2, 2020

Thanks. I've been able to recreate the bug on my own machine, but not sure what's going on just yet. I'll need to investigate...

@deparkes deparkes changed the title Configure logging levels AttributeError: module 'oommftools' has no attribute 'main' May 2, 2020
@deparkes
Copy link
Owner Author

deparkes commented May 2, 2020

I'll try to figure out what is going on, but in the meantime I think your best bet to get up and running is to follow the 'install with anaconda' instructions here: https://github.com/deparkes/OOMMFTools/blob/master/README.md#install-with-anaconda

If you don't have it, you can download anaconda here:
https://www.anaconda.com/products/individual

@JianYugen
Copy link

Hi. Is the problem solved now?

@JianYugen
Copy link

Hi. I've met a similar problem when using Python 3.6 to install and load OOMMFTools on Windows. The error message is shown below:

Traceback (most recent call last):
  File "D:\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Python36\lib\site-packages\oommftools\__main__.py", line 3, in <module>
    oommftools.main()
AttributeError: module 'oommftools' has no attribute 'main'

However, another problem comes out when using Python 2.7 instead. The error message is shown below:

Traceback (most recent call last):
  File "D:\Python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "D:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "D:\Python27\lib\site-packages\oommftools\__main__.py", line 3, in <module>
    oommftools.main()
  File "D:\Python27\lib\site-packages\oommftools\oommftools.py", line 17, in main
    q = MainFrame()
  File "D:\Python27\lib\site-packages\oommftools\oommftools.py", line 62, in __init__
    0, wx.EXPAND | wx.ALIGN_CENTER | wx.TOP | wx.LEFT, 20)
wx._core.wxAssertionError: C++ assertion "!(flags & (wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL)) || !(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL))" failed at ..\..\src\common\sizer.cpp(1453) in wxGridSizer::DoInsert(): wxEXPAND flag will be overridden by alignment flags

OOMMFTools is installed with pip. Here are the installed packages with pip3 (Python 3.6) and pip (Python 2.7):

 >pip3 list
Package    Version
---------- -------
numpy      1.19.5
oommftools 2.0.2
Pillow     8.2.0
pip        21.1.2
scipy      1.5.4
setuptools 40.6.2
six        1.16.0
wxPython   4.1.1
 >pip list
Package    Version
---------- -------
numpy      1.16.6
oommftools 2.0.2
Pillow     6.2.2
pip        20.3.4
scipy      1.2.3
setuptools 41.2.0
six        1.16.0
wheel      0.36.2
wxPython   4.1.0

Could you help me to solve this?

@deparkes
Copy link
Owner Author

deparkes commented Jul 3, 2021

Yes, this is still an issue. There's something wrong with the pip install route. If you are able, your best bet is probably to try following the 'Install With Anaconda' instructions on the readme - https://github.com/deparkes/OOMMFTools#install-with-anaconda

@Anmol-psks
Copy link

Hi. I have install oommftools in my laptop, but when I try to load the oommftools main window with
python -m oommftools
then there comes this message: Traceback (most recent call last):
File "C:\Users\monic\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\monic\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\monic\AppData\Local\Programs\Python\Python37\lib\site-packages\oommftools_main.py", line 3, in
oommftools.main()
AttributeError: module 'oommftools' has no attribute 'main'

Can you help me to solve this problem?

@Anmol-psks
Copy link

I am still facing this problem. please provide some solution

@Anmol-psks
Copy link

i have installed Anaconda now what should i do next
Please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants