This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Assertion error os.path.exists(pyc_path) while building Python 3.8.6 with-ensurepip
Type: behavior Stage: resolved
Components: Build Versions: Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, thoradia
Priority: normal Keywords:

Created on 2020-11-23 17:00 by thoradia, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg381680 - (view) Author: Thoradia Quack (thoradia) Date: 2020-11-23 17:00
I try building Python 3.8.6 with-ensurepip (see configuration below) but this fails with an assertion error (see error below).

I do not understand the error and I do not know how to fix it.

For what it is worth, I used to successfully build Python 3.8.5 with the same configuration.

Thank you for any help with this.

Configuration:
home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/build/Python3-3.8.6/configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain --bindir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/bin --sbindir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/sbin --sysconfdir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/etc --libexecdir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/lib --localstatedir=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/var --disable-static --enable-shared ac_cv_prog_HAS_HG=/bin/false
 ac_cv_prog_SVNVERSION=/bin/false
 --disable-pyc-build
 --disable-ossaudiodev
 --disable-sqlite3
 --disable-codecs-cjk
 --disable-nis
 --enable-unicodedata
 --enable-openssl
 --disable-readline
 --enable-bzip2
 --enable-zlib
 --enable-xz
 --disable-tk
 --disable-curses
 --disable-pydoc
 --disable-test-modules
 --enable-lib2to3
 --disable-idle3
 --without-cxx-main
 --with-expat=builtin
 --with-libmpdec=none
 --with-doc-strings
 --with-system-ffi
 --without-pymalloc
 --with-ensurepip


Error:
if test "xupgrade" != "xno"  ; then \
	case upgrade in \
		upgrade) ensurepip="--upgrade" ;; \
		install|*) ensurepip="" ;; \
	esac; \
	LD_LIBRARY_PATH=/home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/build/Python3-3.8.6/.x86_64-linux-gnu ./python -E -m ensurepip \
		$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpm7whdxa4
Requirement already up-to-date: setuptools in /home/thoradia/9.80.8/build.LibreELEC-RPi4.arm-9.80-devel/toolchain/lib/python3.8/site-packages (49.2.1)
Processing /tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl
Installing collected packages: pip
ERROR: Exception:
Traceback (most recent call last):
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 216, in _main
    status = self.run(options, args)
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 412, in run
    installed = install_given_reqs(
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/req/__init__.py", line 82, in install_given_reqs
    requirement.install(
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/req/req_install.py", line 813, in install
    install_wheel(
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/operations/install/wheel.py", line 852, in install_wheel
    _install_wheel(
  File "/tmp/tmpm7whdxa4/pip-20.2.1-py2.py3-none-any.whl/pip/_internal/operations/install/wheel.py", line 734, in _install_wheel
    assert os.path.exists(pyc_path)
AssertionError
msg381681 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-11-23 17:13
Your problem could be related to --disable-pyc-build. It sounds like it disables pyc compilation, which may explain the exception.

--disable-pyc-build is not supported by official releases of Python. Are you building Python with additional distribution-specific patches?
msg381687 - (view) Author: Thoradia Quack (thoradia) Date: 2020-11-23 18:32
I get the same error when I build without -disable-pyc-build.

I could create the missing directory if only I knew what directory ensurepip is expecting.
msg381691 - (view) Author: Thoradia Quack (thoradia) Date: 2020-11-23 19:44
I build Python with the LibreELEC toolchain.
I removed the --disable-pyc-build and a patch to generate legacy bytecode.
That fixed the issue.
Thank you for the fast answer and for pointing me to the solution.
Closing.
History
Date User Action Args
2022-04-11 14:59:38adminsetgithub: 86612
2020-11-23 19:44:03thoradiasetstatus: open -> closed

messages: + msg381691
stage: resolved
2020-11-23 18:32:39thoradiasetmessages: + msg381687
2020-11-23 17:13:33christian.heimessetnosy: + christian.heimes
messages: + msg381681
2020-11-23 17:00:36thoradiacreate