1

I'm trying to build Python 3.6.4 from LFS 8.2-systemd so I run the configure command:

./configure --prefix=/usr       \
            --enable-shared     \
            --with-system-expat \
            --with-system-ffi   \
            --with-ensurepip=yes

followed by make -j. However, at this point the module "pyexpat" is not found by Python, but the file exists in /usr/lib/libexpat.so.

After reading building Python from source with zlib support, I created a symlink:

ln -s /usr/lib /usr/lib/x86_64-gnu-linux

If i run make install, I get an error:

ModuleNotFoundError: No module named pyexpat

My expat lib version is 2.2.5.

I'm doing the compilation inside env -i chroot /mnt bash and my environment just contains a valid PATH and LX_ALL=POSIX variables.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Chr0nos
  • 67
  • 1
  • 9

2 Answers2

1

I ran into this same problem for python 3.6.8 , when I initially configured using:

./configure --prefix=/opt/python-3.6/ --enable-optimizations

However, when I retried using the command in the BLFS book:

./configure --prefix=/opt/python-3.6/ --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes

My pyexpat started working.

That being said, I think it may be helpful to just retry, since my second command is functionally identical to yours.

Arch Stanton
  • 71
  • 1
  • 2
-2
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

To make python3 use the new installed python 3.6 instead of the default 3.5 release, run following 2 commands:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

Finally switch between the two python versions for python3 via command:

sudo update-alternatives --config python3

After selecting version 3.6:

python3 -V
help-info.de
  • 6,695
  • 16
  • 39
  • 41
  • Welcome to Stack Overflow! Here is a guide on [How to Answer](http://stackoverflow.com/help/how-to-answer). Please note the conventions for formatting [How do I format my posts using Markdown or HTML](http://stackoverflow.com/help/formatting). (see my edit) – help-info.de Apr 25 '19 at 12:07
  • 1
    This is Linux From Scratch. The system almost certainly does not have `apt`. – SeeJayBee May 25 '19 at 00:50