opened
jelazi
username_0
My doxygen write   File "C:\Python36\build\lib\doxyqml\doxyqml.py", line 9, in 
    from . import qmlparser  ImportError: cannot import name 'qmlparser
is any solution?
doxyqml error
issue
created
agateau
username_1
Looks odd, how have you installed doxyqml? Did you use the setup.py script?
comment
created
jelazi
username_0
Yes, I use setup.py 
python c:\Users\.. ...\doxyqml-master\setup.py install
Install is correct

running install
running build
running build_py
copying doxyqml\doxyqml.py -> build\lib\doxyqml
copying doxyqml\lexer.py -> build\lib\doxyqml
copying doxyqml\qmlclass.py -> build\lib\doxyqml
copying doxyqml\qmlparser.py -> build\lib\doxyqml
copying doxyqml\__init__.py -> build\lib\doxyqml
running build_scripts
running install_lib
running install_scripts
running install_egg_info
Removing C:\Python36\Lib\site-packages\doxyqml-0.3.0-py3.6.egg-info
Writing C:\Python36\Lib\site-packages\doxyqml-0.3.0-py3.6.egg-info

Next I added the .qml extension to the FILTER_PATTERNS,FILE_PATTERNS,EXTENSION_MAPPING. 
When I run doxygen I have this output in qml files:Parsing file C:/Users... ...apcontroltesting/StreamerControlButton.qml...
Preprocessing C:/Users... ...apcontroltesting/StreamerGrid.qml...
Traceback (most recent call last):
  File "C:\Python36\build\lib\doxyqml\doxyqml.py", line 9, in 
    from . import qmlparser
ImportError: cannot import name 'qmlparser'
comment
created
agateau
username_1
I am not sure what is happening here. First I thought it could be an issue related to Python 3.6, but I just added 3.6 to the list of Python versions tested by Travis (see #34) and it works, so it's not that. 

Can you try to open doxyqml.py and replace line 9 to read `from doxyqml import qmlparser` instead of `from . import qmlparser`?
comment
created
RandomDudeTwo
username_2
Workaround:
run the Doxygen Gui or cmd (to run doxygen command) with Administrator Privileges
comment
created
sanjaymjoshi
username_3
Here is another potential fix that has worked for me:

In doxyqml.py, replace
`from . import qmlparser
from .lexer import Lexer, LexerError
from .qmlclass import QmlClass`
with 
`from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
import qmlparser
from lexer import Lexer, LexerError
from qmlclass import QmlClass`

Then do similar changes in lexer.py, qmlclass.py, and qmlparser.py.
comment
created
sanjaymjoshi
username_3
I tried the code from above, but now the functional test is failing. Any ideas?
comment
created
Illurian
username_4
Hi, i have installed Doxygen and use it whitout problem. THen i tried to add DoxyQml to it, installing python 37 and last version of pip. I configure doxygen as indicated but when i launch it, i got this error "Traceback (most recent call last):
  File "C:\Python37\Lib\site-packages\doxyqml\doxyqml.py", line 9, in 
    from . import qmlparser
ImportError: cannot import name 'qmlparser' from '__main__' (C:\Python37\Lib\site-packages\doxyqml\doxyqml.py)"
SO actually i cann't use doxygen for QML. Can you help me?
comment
created
mpaperno
username_5
Same problem here....  default install (via both pip or setup.py) gets 
` cannot import name 'qmlparser' from '__main__' (E:\Python3\Lib\site-packages\doxyqml\doxyqml.py)`

I tried both the workaround ideas mentioned here, and both avoid the import errors, but when used from Doxygen both end with:
`doxyqml: error: the following arguments are required: qml_file` (even with full admin privs everywhere).

Using the workaround by @username_2  I can successfully run doxyqml.py directly from a command line.  This suggests some Doxy misconfig, but I've set it all up according to the README. 

My Doxygen is v1.8.14.  I'm using the full path the doxyqml in my FILTER_PATTERNS: 
`*.qml=E:\Python3\Lib\site-packages\doxyqml\doxyqml.py`

Finally solved the "missing arguments" issue by using a simple .bat file as the target for Doxy filter:

`doxyqml.bat`:
```
@E:\Python3\python E:\Python3\Lib\site-packages\doxyqml\doxyqml.py %1
```

FILTER_PATTERNS:  `*.qml=E:\Python3\Lib\site-packages\doxyqml\doxyqml.bat`

Have no clue why this works but invoking `doxyqml.py` directly doesn't.  But at least now my QML is documented... yay!   Thanks @username_1 for the converter!
comment
created
Illurian
username_4
Tried this new version from the fix-windows branch and, if i use FILE_PATTERNS = *.qml, i get : 
'doxyqml' isn't recognize as an internal command.
And if i use *.qml=C:\Python37\Lib\site-packages\doxyqml\doxyqml.py i get : 
Preprocessing C:/Users/rcampred/Documents/Dynamo/src/30_Dynamo0/dynamo-bin/bin/x64/DTest/dynamoCore/utils/inspector/qml/tst_inspector.qml...
Traceback (most recent call last):
  File "C:\Python37\Lib\site-packages\doxyqml\doxyqml.py", line 9, in 
    from . import qmlparser
ImportError: cannot import name 'qmlparser' from '__main__' (C:\Python37\Lib\site-packages\doxyqml\doxyqml.py)
Parsing file C:/Users/rcampred/Documents/Dynamo/src/30_Dynamo0/dynamo-bin/bin/x64/DTest/dynamoCore/utils/inspector/qml/tst_inspector.qml...

So it's seems that the problem still exist.
comment
created
mpaperno
username_5
Check the updated notes in the [README](https://github.com/username_1/doxyqml/pull/44/commits/4e32db7dadad8e2ae1eea278744ab3d9b91b2969).  

You need to _either_ have `C:\Python37\Scripts` in your `PATH` environment variable and use:

`FILTER_PATTERNS        = *.qml=doxyqml` 

_or_ use the (new) full path to the script:

`FILTER_PATTERNS = *.qml=C:\Python37\Scripts\doxyqml`

Also make sure you run the new `setup.py` to get the script in the right place to begin with (in the Python `Scripts` folder).  It is actually called `doxyqml.exe` now.  Sounds like your second attempt was still trying to use the old version.
comment
created
Illurian
username_4
After giving him doxyqml.exe, it work!
But i had to unninstall python and reinstall it to correctly remove the old version of doxyqml, else doxyqml.exe call the old setup.py.
Also i unninstall python becaus i'm bad with it and when i use the uninstall command, python said it cann't do that, so i prefer totaly remove python and reinstal it.
Anyway thank you, now it work for me!
comment
closed
agateau
username_1
issue