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

I found a little error in the file 'hook-PyQt5.QtQml.py' #3864

Closed
LittleWhite-Carry opened this issue Nov 13, 2018 · 8 comments
Closed

I found a little error in the file 'hook-PyQt5.QtQml.py' #3864

LittleWhite-Carry opened this issue Nov 13, 2018 · 8 comments
Assignees
Labels
area:hooks/PyQt5 Related to PyQt5

Comments

@LittleWhite-Carry
Copy link

Hi.

Sorry, I don't know how to use the Pull request. @bjones1

There is a small problem in this file 'hook-PyQt5.QtQml.py'.

I think it should be like this

if qmldir:
    logger.warning('Unable to find Qt5 QML files. QML files not packaged.')

not like this:

if not qmldir:
    logger.warning('Unable to find Qt5 QML files. QML files not packaged.')

This not should be removed

This causes the file to not be properly packaged when the QML path does not exist.

Then when I modified this, the package finally appeared:

Security-Alert: try to store file outside of dist-directory. Aborting. 'C:\\anaconda3\\lib\\site-packages\\PyQt5\\QtWebEngineProcess.exe'

I don't know how this affects, but my program works fine.

This is some information about my environment.
···
Python:3.6
pyinstaller:3.4
PyQt:3.5
···

This is the original question #3229

Thanks

@htgoebel htgoebel added the area:hooks/PyQt5 Related to PyQt5 label Nov 13, 2018
@bjones1
Copy link
Contributor

bjones1 commented Nov 13, 2018

Thanks for the note. However, the logic seems correct to me: if qmldir means that Qt claims to have QML files and provides a valid path to them. However, the directory may not actually exist. I would instead propose the following:

if not os.path.exists(qmldir):
    logger.warning('Unable to find Qt5 QML files. QML files not packaged.')

Would you mind testing this?

In terms of the other error, I think tracking this down isn't worth the effort -- your version of PyQt5 is old and you're using Anaconda, which sometimes causes problems.

@LittleWhite-Carry
Copy link
Author

I changed the code as you said, and it works fine.

Thank you again. @bjones1

@bjones1
Copy link
Contributor

bjones1 commented Nov 14, 2018

Thanks for your report and checking the fix. I'm running this through the standard test suite, then will include these changes.

@amoh-godwin
Copy link

Thanks for the note. However, the logic seems correct to me: if qmldir means that Qt claims to have QML files and provides a valid path to them. However, the directory may not actually exist. I would instead propose the following:

if not os.path.exists(qmldir):
    logger.warning('Unable to find Qt5 QML files. QML files not packaged.')

Would you mind testing this?

In terms of the other error, I think tracking this down isn't worth the effort -- your version of PyQt5 is old and you're using Anaconda, which sometimes causes problems.

Well @bjones1 I use anaconda and the directory exist somewhere in the anaconda parent directory. Don't you think as a piece of advanced software we should be able to create variables that stores all these anaconda paths, thousands if not hundreds of thousands use anaconda. It is the recommended way to get python installed. I could help write a fix, but the rejection on PyInstaller repository is unlike any other. It wont use any PyInstaller variable, since I am quite new, it would be straight forward, you know what I mean. But if that is unacceptable by the PyInstaller team please tell me, so I can stop. Besides you can do it yourself, use anaconda and just search for it.

@bjones1
Copy link
Contributor

bjones1 commented Nov 25, 2018

@amoh-godwin, I don't understand your question. First, are you asking about this issue, or your PR? If you're asking about this issue, are you wanting to add support for PyQt 3.5 on Anaconda? If so, why -- it's easy to use current PyQt5 under Anaconda, and this is fully supported.

@amoh-godwin
Copy link

@bjones1 No, please. I am saying that the directory to the QML files actually exist. But has been placed elsewhere.

@bjones1
Copy link
Contributor

bjones1 commented Nov 26, 2018

The location of the QML directory comes from Qt (QLibraryInfo) and should be correct, regardless of which install (Anaconda's PyQt5 packages vs. PyPI's package).

@amoh-godwin
Copy link

ok

cowo78 pushed a commit to cowo78/pyinstaller that referenced this issue Dec 10, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:hooks/PyQt5 Related to PyQt5
Projects
None yet
Development

No branches or pull requests

4 participants