AttributeError: module 'oommftools' has no attribute 'main'
E.g. debug, info, error etc.
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
Can you help me to solve this problem?
Hi, Could I check how you installed oommftools?
I wrote: pip install oommftools in the cmd of windows. So it started to installing.
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...
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
Hi. Is the problem solved now?
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?
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
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?
I am still facing this problem. please provide some solution
i have installed Anaconda now what should i do next Please help