There is a python library that only wants to be installed in a virtual environment, but how to import the library into scripts running in my standalone application that does not run in a virtual environment?
I'm writing a a Delphi/Lazarus application using the component Python4Delphi and Python4Lazarus to run python scripts.
There are two ways you can try to fix this:
PythonEngine1.DllPath := 'PATH';
import sys import os
venv_path = r"C:\path\to\your\venv\Lib\site-packages"
if venv_path not in sys.path:
sys.path.append(venv_path) # Now you can import your library import your_library