Project

Profile

Help

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

Added by Martin Honnen almost 2 years ago

Hi,

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.


Replies (8)

Please register to reply

RE: 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 - Added by Martin Honnen almost 2 years ago

No. I don't get it with Linux, either.

On Windows, it seems to be the _preload_saxonche_12.1.0.pth file itself that has code to throw that file not found exception if it is not run in an installer environment. I have so far not figured what the pth file is good for or how it is supposed to work "normally".

if not is_pyinstaller:\n        raise FileNotFoundError('.load-order-saxonche-12.1.0' + ' not found')\n")

RE: 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 - Added by Martin Honnen almost 2 years ago

I have tried on three Windows systems now, for SaxonC HE 12.1 I always get that error like

Error processing line 1 of C:\Users\martin\Documents\saxonche-12.1-test\lib\site-packages\_preload_saxonche_12.1.0.pth:

  Traceback (most recent call last):
    File "C:\Users\martin\AppData\Local\Programs\Python\Python310\lib\site.py", line 186, 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

on running a Python program importing saxonche before the program's output.

If I use a venv with 12.0 I don't get any such error.

RE: 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 - Added by Martin Honnen almost 2 years ago

The only Windows where the error didn't occur to me was one where I first installed saxonche 12.1 with pip "globally". But I have yet to find out whether that really makes the difference or whether it was coincidence and some other factor is decisive.

RE: 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 - Added by Martin Honnen almost 2 years ago

I have now tested a fourth Windows system; it didn't have neither saxonche 12.0 nor 12.1. I started with creating a venv enviroment where I pip installed saxonche==12.0.0 and running Python programs with SaxonC don't give any errors or warnings;

Then I created another venv environment where I pip installed saxonche which uses the latest saxonche 12.1.0 and again I get that error (e.g.

(saxonche-12.1-test1) C:\Users\marti\Documents>python Python\saxonc-test1.py
Error processing line 1 of C:\Users\marti\Documents\saxonche-12.1-test1\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
SaxonC-HE 12.1 from Saxonica

The error is even output if you just start python (without using SaxonC) in that virtual environment:

(saxonche-12.1-test1) C:\Users\marti\Documents>python
Error processing line 1 of C:\Users\marti\Documents\saxonche-12.1-test1\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
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32

I will now test on this system if the error goes away if I pip install saxonche 12.1.0 globally.

RE: 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 - Added by Martin Honnen almost 2 years ago

On this Windows 11 system even the "global" pip installation of saxonche gives that error/warning:

C:\Users\marti>"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" -m pip install saxonche
Defaulting to user installation because normal site-packages is not writeable
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

C:\Users\marti>"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" Documents\Python\saxonc-test1.py
Error processing line 1 of C:\Users\marti\AppData\Roaming\Python\Python39\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
SaxonC-HE 12.1 from Saxonica

And then the problem also occurs by just starting Python e.g.

C:\Users\marti>"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"
Error processing line 1 of C:\Users\marti\AppData\Roaming\Python\Python39\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
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32

I don't know how to explain this and it is hard to understand the various directory structures that Python uses e.g. here the Python itself sits in C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe (where VS 2022 installs it), then it uses my user's app data roaming folder C:\Users\marti\AppData\Roaming\Python\Python39\site-packages\ to store/handle site packages.

But somehow that never was a problem with 12.0 and I have pretty much most of my Python/Windows installations set up that way with the usual VS 2022/Python workload installation.

    (1-8/8)

    Please register to reply