Bug 130404 - get-pip.py fails to import _queue.pyd with LibreOffice 6.4.0.3 and embedded python 3.7.6 on Windows 10
Summary: get-pip.py fails to import _queue.pyd with LibreOffice 6.4.0.3 and embedded p...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: target:7.0.0 target:6.4.1
Keywords:
: 130754 131105 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-02-03 22:33 UTC by gaxonegaxone
Modified: 2020-03-03 21:11 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gaxonegaxone 2020-02-03 22:33:34 UTC
Description:
History:
  In LibreOffice 6.3 running on Windows 10, I had installed "pip" into LibreOffice's embedded python without any problem.  I recently upgraded to LO 6.4.0.3 and noticed the embedded python version is now 3.7.6. Thus, python modules I had previously installed thus needed to be reinstalled, including "pip". I began to do that, but ...

Problem:
Installing pip into the new embedded python version 3.7.6 fails with error message:
   ModuleNotFoundError: No module named '_queue'
It appears that module "_queue.pyd" is missing from the python version 3.7.6 files that are embedded in the Windows LibreOffice 6.4.0.3 distribution?

While investigating, I located the _queue.pyd module at: https://www.python.org/ftp/python/3.7.6/python-3.7.6-embed-amd64.zip  .  I extracted it from the zip file and copied it into directory "C:\Program Files\LibreOffice\program\python-core-3.7.6\lib\". I was then able to install pip successfully.

Steps to Reproduce:
1. Install LibreOffice 6.4.0.3 (in my case, I upgraded from LO 6.3)
2. Install python "pip" utility into LibreOffice's embedded python (version 3.7.6) using instructions from https://pip.pypa.io/en/stable/installing/.  I did this by opening a Windows 10 (admin) powershell and entering following commands:
  2a.   cd C:\Program Files\LibreOffice\program\
  2b.   curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  2c.   .\python.exe .\get-pip.py

Actual Results:
After step 2c, see following traceback:


PS C:\Program Files\LibreOffice\program> .\python.exe .\get-pip.py
Traceback (most recent call last):
  File ".\get-pip.py", line 22711, in <module>
    main()
  File ".\get-pip.py", line 198, in main
    bootstrap(tmpdir=tmpdir)
  File ".\get-pip.py", line 82, in bootstrap
    from pip._internal.cli.main import main as pip_entry_point
  File "C:\Users\gax\AppData\Local\Temp\tmpsnual8e6\pip.zip\pip\_internal\cli\main.py", line 10, in <module>
  File "C:\Users\gax\AppData\Local\Temp\tmpsnual8e6\pip.zip\pip\_internal\cli\autocompletion.py", line 9, in <module>
  File "C:\Users\gax\AppData\Local\Temp\tmpsnual8e6\pip.zip\pip\_internal\cli\main_parser.py", line 7, in <module>
  File "C:\Users\gax\AppData\Local\Temp\tmpsnual8e6\pip.zip\pip\_internal\cli\cmdoptions.py", line 31, in <module>
  File "C:\Users\gax\AppData\Local\Temp\tmpsnual8e6\pip.zip\pip\_internal\utils\ui.py", line 20, in <module>
  File "C:\Users\gax\AppData\Local\Temp\tmpsnual8e6\pip.zip\pip\_internal\utils\logging.py", line 9, in <module>
  File "C:\Program Files\LibreOffice\program\python-core-3.7.6\lib\logging\handlers.py", line 28, in <module>
    import queue
  File "C:\Program Files\LibreOffice\program\python-core-3.7.6\lib\queue.py", line 16, in <module>
    from _queue import Empty
ModuleNotFoundError: No module named '_queue'
PS C:\Program Files\LibreOffice\program>

Expected Results:
PS C:\Program Files\LibreOffice\program> .\python.exe .\get-pip.py
Collecting pip
  Using cached pip-20.0.2-py2.py3-none-any.whl (1.4 MB)
Collecting setuptools
  Downloading setuptools-45.1.0-py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 328 kB/s
Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Installing collected packages: pip, setuptools, wheel
  WARNING: The scripts pip.exe, pip3.7.exe and pip3.exe are installed in 'C:\Program Files\LibreOffice\program\python-core-3.7.6\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts easy_install-3.7.exe and easy_install.exe are installed in 'C:\Program Files\LibreOffice\program\python-core-3.7.6\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script wheel.exe is installed in 'C:\Program Files\LibreOffice\program\python-core-3.7.6\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.0.2 setuptools-45.1.0 wheel-0.34.2


Reproducible: Always


User Profile Reset: No



Additional Info:
I suspect the need to include module "_queue.pyd" with embedded python version 3.7.6 is somehow associated with the following python.org change?
   https://bugs.python.org/issue32588  

( see specifically https://bugs.python.org/msg310258 )
Comment 1 gaxonegaxone 2020-02-08 22:26:27 UTC
Missing module _queue.pyd may also be causing problems for the APSO extension on LO 6.4.0.3 on Windows installs?   See:  https://gitlab.com/jmzambon/apso/issues/15
Comment 2 Julien Nabet 2020-02-18 16:13:26 UTC
Michael: Searching about "_queue" on Opengrok, I got:
https://opengrok.libreoffice.org/search?project=core&full=_queue&defs=&refs=&path=&hist=&type=&si=full

python-3.5.4-msvc-disable.patch.1
+ ExternalPackage_python3.mk
in external/python3/
Comment 3 Xisco Faulí 2020-02-18 20:06:53 UTC
patch in gerrit: https://gerrit.libreoffice.org/c/core/+/88977
Comment 4 Commit Notification 2020-02-19 09:25:21 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e62b9937ed33388055560ca0710990742b530aec

tdf#130404 python3: add new windows .pyd modules for 3.7

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Michael Stahl (CIB) 2020-02-19 09:27:16 UTC
hope it's fixed on master; if there are any more .pyd missing then i don't have them built locally
Comment 6 Julien Nabet 2020-02-19 09:28:34 UTC
*** Bug 130754 has been marked as a duplicate of this bug. ***
Comment 7 Commit Notification 2020-02-19 10:42:56 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/fc464ae2441a17f465682420d969ae59d24eacc0

tdf#130404 python3: add new windows .pyd modules for 3.7

It will be available in 6.4.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2020-02-19 13:18:52 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4-1":

https://git.libreoffice.org/core/commit/ea7821ae9fba6675564a694d3e8e465abebc66a2

tdf#130404 python3: add new windows .pyd modules for 3.7

It will be available in 6.4.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 arawkre64 2020-02-24 15:21:52 UTC
the current 6.4.1.2(win10) fixes the problem 

python is working :

C:\Program Files\LibreOffice\program>python
Python 3.7.6 (default, Feb 21 2020, 00:15:25) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import queue
>>>

and also APSO

thanks !
Comment 10 Julien Nabet 2020-03-03 21:11:27 UTC
*** Bug 131105 has been marked as a duplicate of this bug. ***