Python Forum
ModuleNotFoundError: No module named '_struct' when starting pip3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named '_struct' when starting pip3
#1
My OS environment is openSUSE Tumbleweed.

I cloned the latest Python code from git.
git clone -b main --single-branch [email protected]:python/cpython.git
I compiled the code locally, and successfully done after solved all modules error.
./configure --prefix=/opt/python3 --enable-optimizations --with-ensurepip=install
make
sudo make install
And also linked pip and pip3 to new target compiled /opt/python3/bin/pip3.
alts -l pip
alts -l pip3
And also linked /usr/bin/python3 to new target /opt/python3/bin/python3.

Add below into profile for environment setting.
## Python
export PYTHONHOME=/opt/python3
export PYTHONPATH=/opt/python3/lib:/opt/python3/lib64:/opt/python3/lib/python3.11:/opt/python3/lib/python3.11/site-packages

## Update PATH
export PATH=$PYTHONHOME:$PYTHONPATH:$PATH
After above preparation, I got error ModuleNotFoundError: No module named '_struct' when I tried to launch pip, and got error ModuleNotFoundError: No module named 'readline' when I tried to launch python.

Please advise. Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  No module named 'importlib.metadata' EdVS 3 897 Jan-30-2025, 09:55 AM
Last Post: Larz60+
  ModuleNotFoundError: No module named 'athena_read' raman 2 1,223 Jul-01-2024, 07:52 AM
Last Post: Gribouillis
  no module named 'docx' when importing docx MaartenRo 1 5,205 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 30,804 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 9,518 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 4,276 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 3,650 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 3,092 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 2,347 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 17,775 Jun-15-2023, 12:20 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020