For some reason pyinstaller insists on picking poetry's vendorized
version of jsonschema even though I'm removing poetry's entire _vendor
directory out of the search path.

I've added the following snippet at the top of my .spec file to remove
references to poetry's vendorized versions of some libraries:

    search_path = []
    for path in sys.path:
        path = str(pathlib.Path(path).resolve())
        if 'poetry\\core\\_vendor' not in path:
            search_path.append(path)

    sys.path = search_path
    os.environ["PYTHONPATH"] = os.pathsep.join(sys.path)

Later on I print out the path values as well as the directories of the
environments and as you can see there's no reference to poetry\core\_vendor:

    sys.path= 
['C:\\Users\\heuri\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\pyinstaller.exe',
 
'C:\\Users\\heuri\\AppData\\Local\\Programs\\Python\\Python38\\python38.zip', 
'C:\\Users\\heuri\\AppData\\Local\\Programs\\Python\\Python38\\DLLs', 
'C:\\Users\\heuri\\AppData\\Local\\Programs\\Python\\Python38\\Lib', 
'C:\\Users\\heuri\\AppData\\Local\\Programs\\Python\\Python38', 
'C:\\Users\\heuri\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages']
    PYTHONPATH= 
C:\Users\heuri\AppData\Local\Programs\Python\Python38\Scripts\pyinstaller.exe;C:\Users\heuri\AppData\Local\Programs\Python\Python38\python38.zip;C:\Users\heuri\AppData\Local\Programs\Python\Python38\DLLs;C:\Users\heuri\AppData\Local\Programs\Python\Python38\Lib;C:\Users\heuri\AppData\Local\Programs\Python\Python38;C:\Users\heuri\AppData\Local\Programs\Python\Python38\Lib\site-packages
    launcher's site-packages= 
C:\Users\heuri\AppData\Local\pypoetry\Cache\virtualenvs\REDACTED-launcher-MKijLxw9-py3.8\Lib\site-packages
    dashboard's site-packages= 
C:\Users\heuri\AppData\Local\pypoetry\Cache\virtualenvs\REDACTED-Mh8E0adn-py3.8\Lib\site-packages
 
Yet pyinstaller keeps picking _vendor\jsonschema at COLLECT and fails:

    Security-Alert: try to store file outside of dist-directory. Aborting. 
'c:\\users\\heuri\\appdata\\local\\programs\\python\\python38\\lib\\site-packages\\poetry\\core\\_vendor\\jsonschema\\benchmarks\\__pycache__\\json_schema_test_suite.cpython-38.pyc'

I've added regular and pre_find_module_path (to filter out poetry paths)
hooks for jsonschema but they didn't change a thing.

What are my options?

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/c1d54226-a8f2-4cba-bf5e-543c6b6accd7n%40googlegroups.com.

Reply via email to