https://bugs.documentfoundation.org/show_bug.cgi?id=168215

--- Comment #2 from [email protected] ---
Workarounds for those who interested:

1. Copy venv module from Python distribution of the same version to the
   "C:\Program Files\LibreOffice\program\python-core-3.11.13\lib" dir.
   After that, python -m venv venv command should succeed.
2. In order to install pysqlite3 with pip, you should prepare VS environment
first.
   Follow these steps:
2.1 Have MSVS 2019 (any edition) installed
2.2 Download Python source code and copy contents of its Include dir to the
Include dir located in the venv
2.3 Now the hard part - recreating Python3.lib:
2.3.1 Open "x64 Native Tools Command Prompt for VS 2019" console
2.3.2 Run command "dumpbin /EXPORTS Python311.dll > Python3.def"
2.3.3 Add these two lines at the beginning:
      LIBRARY PYTHON3
      EXPORTS
2.3.4 Edit/remove everything else so each line contains only a function name,
like:
      PyAIter_Check
      PyArg_Parse
      PyArg_ParseTuple
      ...
      _Py_write_noraise

      (total 1632 functions for python311.dll)
2.3.5 Now create import library with this command:
      lib /DEF:Python3.def /OUT:Python3.lib /MACHINE:X64
2.4 Copy obtained Python3.lib to the virtual environment's venv\libs folder
(don't confuse with "Lib"!)
2.5 Activate the venv and run "pip install pysqlite3", it should build the
dependencies needed
2.6 Symlink or just copy pysqlite3 as sqlite3
3. If _lzma is necessary, copy _lzma.pyd from an official distribution to the
"C:\Program Files\LibreOffice\program" dir.
4. Now run "pip install oooenv ooo-dev-tools types-scriptforge oooscript
spyder"
5. Hope it's worked, the last step is to copy python.exe from LO program folder
with the name "pythonw.exe" to the venv\Scripts folder
6. Now type "spyder" and it should run

NB: I'm writing all these from my memory so I could have missed something...

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to