![]() |
ModuleNotFoundError: No module named '_struct' when starting pip3 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: ModuleNotFoundError: No module named '_struct' when starting pip3 (/thread-37141.html) |
ModuleNotFoundError: No module named '_struct' when starting pip3 - yuhuihu - May-05-2022 My OS environment is openSUSE Tumbleweed .I cloned the latest Python code from git. git clone -b main --single-branch [email protected]:python/cpython.gitI compiled the code locally, and successfully done after solved all modules error. ./configure --prefix=/opt/python3 --enable-optimizations --with-ensurepip=install make sudo make installAnd also linked pip and pip3 to new target compiled /opt/python3/bin/pip3 . alts -l pip alts -l pip3And 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:$PATHAfter 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. |