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
ModuleGraph can get confused by symlinks #1750
Comments
Said two lines resolve the sym-link (using I can see no reason, why I assume, it should be save to replace this by Any opinions? Should this go into release 3.1? |
I see no reason for these two lines -- if tests pass with them removed, I'd suggest including this in v3.1. |
I did try to run the tests with those lines removed, the tests seem to leak temporary files and I ran out of disk space... Is this a known problem? |
I'm trying to package an application that uses PyQt5 and QScintilla2 on OSX. Building the package works fine, but when it comes to run, it fails with an
ImportError
on:This is because although
ModuleGraph
is able to find and import thePyQt5
package, it's not able to findPyQt5.Qsci
, because it's looking in the wrong place.I've installed PyQt5 with homebrew, which puts the relevant
.so
files in/usr/local/Cellar/pyqt5/5.5.1/lib/python3.5/site-packages/PyQt5/
, and then creates a symlink to each.so
file in/usr/local/lib/python3.5/site-packages/PyQt5/
.I've also installed QScintilla2 with homebrew, which puts
Qsci.so
in/usr/local/Cellar/qscintilla2/2.8.4/lib/python3.5/site-packages/PyQt5/
, and symlinks this to/usr/local/lib/python3.5/site-packages/PyQt5/Qsci.so
.The problem comes when
ModuleGraph
tries to work out where it should be importingPyQt5.Qsci
from. I think it assumes thatPyQt5.Qsci
's "head" package is thePyQt5
package. It has previously found thePyQt5
package in/usr/local/lib/python3.5/site-packages/PyQt5/
, but viaModuleGraph._find_module
's call toos.path.realpath
, it records thePyQt5
package as being in/usr/local/Cellar/pyqt5/5.5.1/lib/python3.5/site-packages/PyQt5/
.As such, it tries to look here for
PyQt5.Qsci
, and this fails.Commenting out these two lines causes the build to produce something usable. Beyond that though, I'm not sure what to recommend as a fix -- I assume those lines are there for a reason, but it looks like they've been there since the modulegraph project was imported into bitbucket almost ten years ago!
The text was updated successfully, but these errors were encountered: