Issue 33903: Can't use lib2to3 with embeddable zip file (original) (raw)

Created on 2018-06-19 14:47 by Tiger-222, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg319974 - (view) Author: Mickaël Schoentgen (Tiger-222) * Date: 2018-06-19 14:47
As stated by https://bugs.python.org/issue24960, the bug should be fixed in 3.6.5 (if it is the same, not sure). Simple reproduction steps are: 1) Download and unzip python-3.6.5-embed-win32.zip. 2) Install pip (OK): C:\Users\TestW764\python-3.6.5-embed-win32> python get-pip.py Collecting pip Using cached https://files.pythonhosted.org/packages/0f/74/.../pip-10.0.1-py2.py3-none-any.whl Collecting setuptools Using cached https://files.pythonhosted.org/packages/7f/e1/.../setuptools-39.2.0-py2.py3-none-any.whl Collecting wheel Using cached https://files.pythonhosted.org/packages/81/30/.../wheel-0.31.1-py2.py3-none-any.whl Installing collected packages: pip, setuptools, wheel The script wheel.exe is installed in 'C:\Users\TestW764\python-3.6.5-embed-win32\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-10.0.1 setuptools-39.2.0 wheel-0.31.1 3) In python36._pth, uncomment "import site". 4) Try to install anything else: C:\Users\TestW764\python-3.6.5-embed-win32> python -m pip install nuxeo Collecting nuxeo Using cached https://files.pythonhosted.org/packages/b3/c9/.../nuxeo-2.0.1.tar.gz Complete output from command python setup.py egg_info: running egg_info creating pip-egg-info\nuxeo.egg-info writing pip-egg-info\nuxeo.egg-info\PKG-INFO writing dependency_links to pip-egg-info\nuxeo.egg-info\dependency_links.txt writing requirements to pip-egg-info\nuxeo.egg-info\requires.txt writing top-level names to pip-egg-info\nuxeo.egg-info\top_level.txt writing manifest file 'pip-egg-info\nuxeo.egg-info\SOURCES.txt' error: [Errno 0] Error: 'lib2to3\\Grammar3.6.5.final.0.pickle' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users\TestW764\AppData\Local\Temp\pip-install-0gzz8yfg\nuxeo\ Do you think it is a sub-issue of 24960, something new or I bug from my side?
msg320123 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-06-20 22:31
This is by design. If you want to install packages into a directory that includes the embeddable zip, you'll need either the matching full install of Python or the Nuget package and use the "--target" argument to pip to put the packages in your directory. See https://docs.python.org/3/using/windows.html#embedded-distribution for more information about using this package.
msg320124 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-06-20 22:33
Oh, and is not the same. That one is related primarily to having the entire standard library in a zip file. That may be the case for the embeddable distro, but the embeddable distro is also not intended to support installing packages itself, so it is out of scope. (Though there's a possibility that the grammar files are not generated in the Nuget packages either, so you may need to use a full install for packages requiring 2to3.)
msg320143 - (view) Author: Mickaël Schoentgen (Tiger-222) * Date: 2018-06-21 08:54
In my case, on the computer doing releases, I cannot use the full Python installer (even with a minimal unattend.xml file) because any software installation is prohibited. This is an issue in my side but it is for the context. I was expecting to be able to install modules even with the embeddable Python. I do not see that limitation in the docs. The issue here is that I cannot install a package with no wheel because pip requires 'lib2to3\\Grammar3.6.5.final.0.pickle' (even if I am targetting python 3.6 only). Do you see it as an issue or a desired behavior?
msg320174 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-06-21 13:04
There's a command to generate that file though I forget what it is. The embeddable distro does not support installation, though it may work sometimes (it's still the same Python binaries). Try going to nuget.org, search for Python and install one of those packages (there should be instructions on the site). Alternatively, I think the WinPython distro has a non-installed version that you may be able to use.
History
Date User Action Args
2022-04-11 14:59:01 admin set github: 78084
2018-06-21 13:04:41 steve.dower set messages: +
2018-06-21 08:54:30 Tiger-222 set messages: +
2018-06-20 22:33:40 steve.dower set messages: +
2018-06-20 22:31:25 steve.dower set status: open -> closedresolution: not a bugmessages: + stage: resolved
2018-06-20 19:38:15 brett.cannon set nosy: + paul.moore, tim.golden, zach.ware, steve.dowercomponents: + Windows
2018-06-19 14:47:37 Tiger-222 create