Bug #5934
closedSaxonC Python wheels don't work in a virtual environment on Windows
100%
Description
Issue Reported by user here: https://saxonica.plan.io/boards/4/topics/9334
I get a strange error (probably on the console error output) running any Python using saxonche 12.1 from PyPi in a venv environment under Windows:
C:\Users\marti\PycharmProjects\SaxonCHE12.1PyPipTest\venv\Scripts\python.exe C:\Users\marti\PycharmProjects\SaxonCHE12.1PyPipTest\processor_test.py
Error processing line 1 of C:\Users\marti\PycharmProjects\SaxonCHE12.1PyPipTest\venv\lib\site-packages\_preload_saxonche_12.1.0.pth:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "<string>", line 18, in <module>
FileNotFoundError: .load-order-saxonche-12.1.0 not found
Remainder of file ignored The program then runs without problem and its output appears. But any run of any program using SaxonC emits that error message/warning.
Updated by Norm Tovey-Walsh over 1 year ago
I get a strange error (probably on the console error output) running
any Python using saxonche 12.1 from PyPi in a venv environment under
Windows:
Can you describe how you setup venv?
Be seeing you,
norm
--
Norm Tovey-Walsh
Saxonica
Updated by Martin Honnen over 1 year ago
Either let I Pycharme do it or I do it from the command line with e.g. python3.exe -m venv saxonche-12.1-test
and (on Windows cmd shell then) saxonche-12.1-test\Scripts\activate.bat
and then python -m pip install saxonche
.
Updated by Norm Tovey-Walsh over 1 year ago
Either let I Pycharme do it or I do it from the command line with e.g.
python3.exe -m venv saxonche-12.1-test and (on Windows cmd shell then)
saxonche-12.1-test\Scripts\activate.bat and then python -m pip install
saxonche.
Thanks.
I’ve reproduced it:
PS C:\Users\Norman Walsh> .\saxon-test-1\Scripts\activate
(saxon-test-1) PS C:\Users\Norman Walsh> python -m pip install saxonche
Collecting saxonche
Using cached saxonche-12.1.0-cp39-cp39-win_amd64.whl (16.9 MB)
Installing collected packages: saxonche
Successfully installed saxonche-12.1.0
WARNING: You are using pip version 20.2.3; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\Norman Walsh\saxon-test-1\Scripts\python.exe -m pip install --upgrade pip' command.
(saxon-test-1) PS C:\Users\Norman Walsh> python .\smoke-he.py
Error processing line 1 of C:\Users\Norman Walsh\saxon-test-1\lib\site-packages_preload_saxonche_12.1.0.pth:
Traceback (most recent call last):
File "C:\Python39\lib\site.py", line 169, in addpackage
exec(line)
File "", line 1, in
File "", line 18, in
FileNotFoundError: .load-order-saxonche-12.1.0 not found
Remainder of file ignored
SaxonC-HE 12.1 from Saxonica
Unfortunately, I’m no closer to having a clue what it means. :-(
Be seeing you,
norm
--
Norm Tovey-Walsh
Saxonica
Updated by Norm Tovey-Walsh over 1 year ago
- Subject changed from strange error with he 12.1 under Windows when using PyPi package in venv: Error processing line 1 of C:\Users\marti\ProjectPath\venv\lib\site-packages\_preload_saxonche_12.1.0.pth: FileNotFoundError: .load-order-saxonche-12.1.0 not found to SaxonC doesn't work in a virtual environment on Windows
Updated by Norm Tovey-Walsh over 1 year ago
- Subject changed from SaxonC doesn't work in a virtual environment on Windows to SaxonC Python wheels don't work in a virtual environment on Windows
Updated by Norm Tovey-Walsh over 1 year ago
- Status changed from New to Resolved
This appears to have been caused by an unpinned reference to the delvewheel
process which was upgraded after our last release. The new versions attempt to deal with delayed loading of DLLs by adding this '.pth' file but that clearly breaks virtual environments.
I've pinned the version of delvewheel
to 1.2.0 and that seems to have resolved the problem.
Updated by O'Neil Delpratt over 1 year ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 12.2
Bug fix applied in the SaxonC 12.2 maintenance release.
Please register to edit this issue