You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/ #78239
The default Python 3.7 install (./configure with no parameters) does not work (at least) on openSUSE Leap 42.3.
Python3 gives a ModuleNotFoundError: No module named 'readline'
error, and pip3 has a ModuleNotFoundError: No module named '_socket' error, because the site libraries cannot be found.
The fix is to manually:
sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload
The same problem should also be present with a PYTHONHOME other than the default /usr/local .
I suspect this is a more widespread problem than just openSUSE Leap 42.3, and may exist in other distros as well.
The fix should be for make install to automatically create the symbolic link for the $PYTHONHOME/lib64/python3.7/lib-dynload directory in $PYTHONHOME/lib/python3.7/ .
This isn't for the OpenSUSE official build itself, just compiling and installing from source on OpenSUSE 42.3. Without the symlink, and also with a wrong PYTHONHOME, pip coredumps.
The output of make after a make clean is attached.
For readline, on openSUSE 42.3 you have to install ncurses-devel, not libreadline-dev. The instructions aren't clear about this either, or the fact that an ncurses or readline development library has to be installed separately. However, this didn't cause the "readline" problem, since the shared libraries were in /usr/local/lib64 instead of /usr/local/lib, and so they couldn't be found in any case.
cooperlees commented on Jun 12, 2019
cooperleesmannequin
Mannequin
More actions
I also have the same problem with _socket that was Fixed on the latest version of CentOS 7 building with gcc 4.8.5.
bpo-1294959 has been fixed by commit 8510f43, but this issue is about "./configure with no parameters".
This issue seems to be about OpenSuSE downstream patches: "just compiling and installing from source on OpenSUSE 42.3."
I found multiple similar old issues.
bpo-15631: "Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders", "error: ImportError: No module named 'atexit'". The reporter used downstream patch: "I applied the OpenSUSE patch".
bpo-18092: "Python 2.7.5 installation broken on OpenSuse 12.2", error: "ImportError: No module named _collections". The reporter never explained how Python was configured: "Please provide exactly what ./configure options you used to build Python and any "make install" options."
bpo-30633: "Python 3.6.1 installation issues on OpenSuse 42.1: ModuleNotFoundError: No module named 'encodings'", error: "Fatal Python error: Py_Initialize: Unable to get the locale encoding". Same reporter name than bpo-18092 "Andreas Jung", but different bugs.python.org login name ("zopyx" vs "Andreas.Jung". The reporter says that he used "the standard ./configure --prefix=... --enable-optimizations" but not if he applied any OpenSuSE downstream patch.
=> closed as out of date in 2019 after 2 years of inactivity
This issuse is now 2 years old and it doesn't have a clear description. It started with "just compiling and installing from source on OpenSUSE 42.3", then switched to "I got the source directly from www.python.org" to finish with "I also have the same problem (...) on the latest version of CentOS 7".
I close the issue.
If someone wants to reopen the issue, please clearly explains:
how you get Python
did you apply any patch on it
how did you configure Python? (configure command)
how did you built Python?
how did you install Python?
how do you run Python?
what is your operating system?
what is your locale (LC_ALL, LC_CTYPE and LANG environment variable)?
do you have any environment variable with a name starting with PYTHON?
So far, we only got unclear bug reports with partial information and we could only guess what the reporter did.
Since this issue started with OpenSuSE downstream patches, I mark also this issue as a duplicate of bpo-1294959.
Activity
tkandell commentedon Jul 6, 2018
The default Python 3.7 install (./configure with no parameters) does not work (at least) on openSUSE Leap 42.3.
Python3 gives a ModuleNotFoundError: No module named 'readline'
error, and pip3 has a ModuleNotFoundError: No module named '_socket' error, because the site libraries cannot be found.
The fix is to manually:
sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload
The same problem should also be present with a PYTHONHOME other than the default /usr/local .
I suspect this is a more widespread problem than just openSUSE Leap 42.3, and may exist in other distros as well.
The fix should be for make install to automatically create the symbolic link for the $PYTHONHOME/lib64/python3.7/lib-dynload directory in $PYTHONHOME/lib/python3.7/ .
terryjreedy commentedon Jul 7, 2018
A crash, for the tracker, is failed execution without a Python exception and trackback.
Debian, Fedora, Gentoo, RHEL, and Ubuntu (AMD64) buildbots are currently green. We don't have one for SUSE, open or other wise.
If you have not yet reported the issue to openSUSE, I would do so in case this is something they should deal with.
Victor, do you have anything to add?
tkandell commentedon Jul 7, 2018
This isn't for the OpenSUSE official build itself, just compiling and installing from source on OpenSUSE 42.3. Without the symlink, and also with a wrong PYTHONHOME, pip coredumps.
terryjreedy commentedon Jul 7, 2018
Did you get the source from openSUSE or from python.org?
vstinner commentedon Jul 7, 2018
Can we please recommpile Python from scratch and attach the output of make? Example:
./configure
make 2>&1 | tee log
And attach log to this ticket.
vstinner commentedon Jul 7, 2018
For readline, you probably have to install a dependency like: libreadline-dev.
vstinner commentedon Jul 7, 2018
We have SLES buildbots, that's OpenSUSE no?
tkandell commentedon Jul 7, 2018
I got the source directly from www.python.org
tkandell commentedon Jul 7, 2018
./configure output
default, no parameters
tkandell commentedon Jul 7, 2018
The output of make after a make clean is attached.
For readline, on openSUSE 42.3 you have to install ncurses-devel, not libreadline-dev. The instructions aren't clear about this either, or the fact that an ncurses or readline development library has to be installed separately. However, this didn't cause the "readline" problem, since the shared libraries were in /usr/local/lib64 instead of /usr/local/lib, and so they couldn't be found in any case.
cooperlees commentedon Jun 12, 2019
I also have the same problem with _socket that was Fixed on the latest version of CentOS 7 building with gcc 4.8.5.
Adding:
sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload
Allowed the .so to be found and the import to work.
vstinner commentedon Mar 11, 2020
bpo-1294959 has been fixed by commit 8510f43, but this issue is about "./configure with no parameters".
This issue seems to be about OpenSuSE downstream patches: "just compiling and installing from source on OpenSUSE 42.3."
I found multiple similar old issues.
bpo-15631: "Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders", "error: ImportError: No module named 'atexit'". The reporter used downstream patch: "I applied the OpenSUSE patch".
=> closed as a duplicate of bpo-1294959
=> closed as a duplicate of bpo-1294959
=> closed as out of date in 2019 after 2 years of inactivity
vstinner commentedon Mar 11, 2020
This issuse is now 2 years old and it doesn't have a clear description. It started with "just compiling and installing from source on OpenSUSE 42.3", then switched to "I got the source directly from www.python.org" to finish with "I also have the same problem (...) on the latest version of CentOS 7".
I close the issue.
If someone wants to reopen the issue, please clearly explains:
So far, we only got unclear bug reports with partial information and we could only guess what the reporter did.
Since this issue started with OpenSuSE downstream patches, I mark also this issue as a duplicate of bpo-1294959.