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
Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders #59836
On opensuse 12.1, python 3.3 installs its extensions in /usr/local/lib64/python3.3/lib-dynload/, but the .py files are in /usr/local/lib/python3.3/.
When launching python 3.3 one gets:
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.3.0b1 (default, Aug 11 2012, 10:45:34)
[GCC 4.6.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 5, in <module>import atexit
File "<frozen importlib._bootstrap>", line 1294, in _find_and_load
File "<frozen importlib._bootstrap>", line 1258, in _find_and_load_unlockedImportError: No module named 'atexit'
The same thing happens when installing with a --prefix.
Moving the directory lib64/python3.3/lib-dynload to lib/python3.3/lib-dynload fixes the problem.
and this seems to be a patched/distro installation. Do you see this with an unpatched one as well?
ita1024 commented on Aug 13, 2012
ita1024mannequin
MannequinAuthor
More actions
I have not modified anything related to python on my opensuse install, i have only grabbed the latest tarball, compiled and installed.
Here is the result with python 3.3.0 beta 2
./configure
make
(sudo make install) > log
I am observing the same outputs:
$ /usr/local/bin/python3.3
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.3.0b2 (default, Aug 14 2012, 00:25:40)
[GCC 4.6.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 5, in <module>
import atexit
ImportError: No module named 'atexit'
>>> import atexit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'atexit'
>>>
The file /etc/pythonstart contains:
"""
# startup script for python to enable saving of interpreter history and
# enabling name completion
# import needed modulesimportatexitimportosimportreadlineimportrlcompleter# where is history savedhistoryPath=os.path.expanduser("~/.pyhistory")
# handler for saving historydefsave_history(historyPath=historyPath):
importreadlinereadline.write_history_file(historyPath)
# read history, if it existsifos.path.exists(historyPath):
readline.set_history_length(10000)
readline.read_history_file(historyPath)
# register saving handleratexit.register(save_history)
# enable completionreadline.parse_and_bind('tab: complete')
# cleanup
del os, atexit, readline, rlcompleter, save_history, historyPath
"""
I will attach _sysconfigdata.py next (only one attachment)
I applied the OpenSUSE patch to the current cpython tip (3.4a0), rebuilt, then reinstalled. I verified that sys.path contains directories which contain "lib64". I can import the time module now, which failed before applying the patch.
The patch didn't apply perfectly (two chunks were slightly offset), so I generated a new patch, which is attached.
It's been awhile since I did anything with bug reports. I tweaked a few fields. Let me know if I muffed anything.
it breaks the installation on 64bit platforms on Debian and Ubuntu.
Please test the patch on one of these platforms too.
it hardcodes more platform information in the sys modules, which
makes it difficult to overwrite for cross builds. If these macros
are needed then they should be taken from the sysconfig module,
using the _sysconfigdata module.
use the host macros in the configure instead of uname
LIB shouldn't be necessary when configuring --with-libdir
it breaks the installation on 64bit platforms on Debian and Ubuntu.
Please test the patch on one of these platforms too.
it hardcodes more platform information in the sys modules, which
makes it difficult to overwrite for cross builds. If these macros
are needed then they should be taken from the sysconfig module,
using the _sysconfigdata module.
use the host macros in the configure instead of uname
LIB shouldn't be necessary when configuring --with-libdir
Sorry, I don't have access to anything but the OpenSUSE systems at
work. I was just verifying that it solved my installation problems.
I'll see if I can nudge some of the other things forward.
changed the title [-]Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders[/-][+]Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders[/+]on Oct 6, 2012
rpetrov commented on Oct 7, 2012
rpetrovmannequin
Mannequin
More actions
Skip,
You mix two technologies one is --libdir that could be specified at configure time and another one is sub-directory name for libraries as path suffix to some prefixes.
You could just adjust python to use user specified path (--libdir) and this is more flexible instead you hard coded stuff in configure script.
rpetrov commented on Oct 7, 2012
rpetrovmannequin
Mannequin
More actions
Also I could not understand why is opened new issue.
Just search for libdir and one is bpo-1294959 - 7 years old with the same idea. Later mean that solution is not acceptable.
Before this goes any farther, let me make this clear - I *did not* develop this patch. It was developed by the OpenSUSE folks. I had trouble installing Python from source on the OpenSUSE system under my desk at work. I asked about the problem on python-list@python.org. Someone directed me to this open bug report. I saw the reference to the patch, applied it, and installed. I verified that the installed Python executable now works as I expected, and reported that. That is all I did. Various responses seem to suggest that people think I wrote the patch. I did not. I didn't even look at the contents of the patch before applying it. I regenerated it relative to the current hg trunk simply because when I first applied it, a couple chunks were applied with offsets.
If my feedback is not sufficient to help move this bug report forward, my apologies. I know next to nothing about writing configure scripts, let alone the right way to do that. I don't mess around at this level of things any more. Haven't in at least a decade. I don't know what a host macro is. I have never used --libdir. If people are looking to me to correct the flaws in this patch, they are likely going to wait for awhile.
cataliniacob commented on Aug 1, 2013
cataliniacobmannequin
Mannequin
More actions
In reply to msg168184, LIBDIR is set to include lib64 instead of lib because openSUSE explicitly does it that way in their multilib implementation.
More specifically, the CONFIG_SITE environment variable is set to /usr/share/site/x86_64-unknown-linux-gnu which contains, among more stuff:
catalin@opensuse:~/hacking/cpython> cat $CONFIG_SITE | grep libdir
# If user did not specify libdir, guess the correct target:
if test "$libdir" = '${exec_prefix}/lib' ; then
libdir='${exec_prefix}/lib64'
/usr/share/site/x86_64-unknown-linux-gnu is owned by package site-config whose README says:
site-config: Site Paths Configuration for autoconf Based configure Scripts
==========================================================================
Site configuration for autoconf based configure scripts provides smart
defaults for paths that are not specified.
All autoconf based configure scripts will automatically resource site
script using CONFIG_SITE environment variable. It works without any
explicit user interaction.
Currently implemented features:
Automatic libdir setup to $exec_prefix/lib or $exec_prefix/lib64
----------------------------------------------------------------
Depending on architecture, site script should correctly and
automatically switch between lib and lib64 libdir.
libexecdir setup to $exec_prefix/lib
------------------------------------
Upstream libexecdir defaults to $exec_prefix/libexec. This directory is
not part of FHS 2.2, so we change it to $exec_prefix/lib (yes, it is
correct to set it to $exec_prefix/lib even for bi-arch platforms). Most
projects add package name to this path, so you most probably get what
FHS 2.2 expects.
When installing Python 3.6.3 from source on openSUSE Leap 42.2, this bug still occurs. Python cannot find the readline module, until you symlink $prefix/lib/python3.6/lib-dynload to $prefix/lib64/python3.6/lib-dynload.
Activity
ita1024 commentedon Aug 12, 2012
On opensuse 12.1, python 3.3 installs its extensions in /usr/local/lib64/python3.3/lib-dynload/, but the .py files are in /usr/local/lib/python3.3/.
The same thing happens when installing with a --prefix.
Moving the directory lib64/python3.3/lib-dynload to lib/python3.3/lib-dynload fixes the problem.
doko42 commentedon Aug 13, 2012
please could you attach the configure options, generated _sysconfigdata.py and a log of the install step?
doko42 commentedon Aug 13, 2012
and this seems to be a patched/distro installation. Do you see this with an unpatched one as well?
ita1024 commentedon Aug 13, 2012
I have not modified anything related to python on my opensuse install, i have only grabbed the latest tarball, compiled and installed.
Here is the result with python 3.3.0 beta 2
./configure
make
(sudo make install) > log
I am observing the same outputs: $ /usr/local/bin/python3.3 Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Python 3.3.0b2 (default, Aug 14 2012, 00:25:40) [GCC 4.6.2] on linux Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "/etc/pythonstart", line 5, in <module> import atexit ImportError: No module named 'atexit' >>> import atexit Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'atexit' >>>The file /etc/pythonstart contains:
"""
# startup script for python to enable saving of interpreter history and
# enabling name completion
# cleanup
del os, atexit, readline, rlcompleter, save_history, historyPath
"""
I will attach _sysconfigdata.py next (only one attachment)
ita1024 commentedon Aug 13, 2012
Here is the generated Lib/_sysconfigdata.py file
doko42 commentedon Aug 14, 2012
the configure step sets LIBDIR to /usr/local/lib64. Please find out why this is not set to /usr/local/lib.
nathanr commentedon Oct 1, 2012
This is also an issue on openSUSE 12.2 with the release version of Python 3.3 when compiling from sources.
OBS (openSUSE Build Service) has RPMs for 3.3rc1. I'm assuming they've got a patch which fixes this issue, and looking at the spec file (lines 61, 62 - https://build.opensuse.org/package/view_file?file=python3.spec&package=python3&project=devel%3Alanguages%3Apython%3AFactory&rev=cb7b94b33478cb8add5a5eb3ab3068dc):
# support lib-vs-lib64 distinction
Patch02: Python-3.3.0b2-multilib.patch
The URL for that patch is https://build.opensuse.org/package/view_file?file=Python-3.3.0b2-multilib.patch&package=python3&project=devel%3Alanguages%3Apython%3AFactory&rev=cb7b94b33478cb8add5a5eb3ab3068dc
I haven't verified it, but I'm guessing that patch has something to do with the issue.
The top level directory for the sources for their RPMs are at https://build.opensuse.org/package/files?package=python3&project=devel%3Alanguages%3Apython%3AFactory
smontanaro commentedon Oct 6, 2012
I applied the OpenSUSE patch to the current cpython tip (3.4a0), rebuilt, then reinstalled. I verified that sys.path contains directories which contain "lib64". I can import the time module now, which failed before applying the patch.
The patch didn't apply perfectly (two chunks were slightly offset), so I generated a new patch, which is attached.
It's been awhile since I did anything with bug reports. I tweaked a few fields. Let me know if I muffed anything.
[-]Python 3.3 beta 1 installation issue lib/lib64 folders[/-][+]Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders[/+]doko42 commentedon Oct 6, 2012
the proposed patch has still some issues:
it breaks the installation on 64bit platforms on Debian and Ubuntu.
Please test the patch on one of these platforms too.
it hardcodes more platform information in the sys modules, which
makes it difficult to overwrite for cross builds. If these macros
are needed then they should be taken from the sysconfig module,
using the _sysconfigdata module.
use the host macros in the configure instead of uname
LIB shouldn't be necessary when configuring --with-libdir
smontanaro commentedon Oct 6, 2012
Sorry, I don't have access to anything but the OpenSUSE systems at
work. I was just verifying that it solved my installation problems.
I'll see if I can nudge some of the other things forward.
[-]Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders[/-][+]Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders[/+]rpetrov commentedon Oct 7, 2012
Skip,
You mix two technologies one is --libdir that could be specified at configure time and another one is sub-directory name for libraries as path suffix to some prefixes.
You could just adjust python to use user specified path (--libdir) and this is more flexible instead you hard coded stuff in configure script.
rpetrov commentedon Oct 7, 2012
Also I could not understand why is opened new issue.
Just search for libdir and one is bpo-1294959 - 7 years old with the same idea. Later mean that solution is not acceptable.
smontanaro commentedon Oct 7, 2012
Before this goes any farther, let me make this clear - I *did not* develop this patch. It was developed by the OpenSUSE folks. I had trouble installing Python from source on the OpenSUSE system under my desk at work. I asked about the problem on python-list@python.org. Someone directed me to this open bug report. I saw the reference to the patch, applied it, and installed. I verified that the installed Python executable now works as I expected, and reported that. That is all I did. Various responses seem to suggest that people think I wrote the patch. I did not. I didn't even look at the contents of the patch before applying it. I regenerated it relative to the current hg trunk simply because when I first applied it, a couple chunks were applied with offsets.
If my feedback is not sufficient to help move this bug report forward, my apologies. I know next to nothing about writing configure scripts, let alone the right way to do that. I don't mess around at this level of things any more. Haven't in at least a decade. I don't know what a host macro is. I have never used --libdir. If people are looking to me to correct the flaws in this patch, they are likely going to wait for awhile.
cataliniacob commentedon Aug 1, 2013
In reply to msg168184, LIBDIR is set to include lib64 instead of lib because openSUSE explicitly does it that way in their multilib implementation.
More specifically, the CONFIG_SITE environment variable is set to /usr/share/site/x86_64-unknown-linux-gnu which contains, among more stuff:
catalin@opensuse:~/hacking/cpython> cat $CONFIG_SITE | grep libdir
# If user did not specify libdir, guess the correct target:
if test "$libdir" = '${exec_prefix}/lib' ; then
libdir='${exec_prefix}/lib64'
/usr/share/site/x86_64-unknown-linux-gnu is owned by package site-config whose README says:
site-config: Site Paths Configuration for autoconf Based configure Scripts
==========================================================================
Site configuration for autoconf based configure scripts provides smart
defaults for paths that are not specified.
All autoconf based configure scripts will automatically resource site
script using CONFIG_SITE environment variable. It works without any
explicit user interaction.
Currently implemented features:
Automatic libdir setup to $exec_prefix/lib or $exec_prefix/lib64
----------------------------------------------------------------
Depending on architecture, site script should correctly and
automatically switch between lib and lib64 libdir.
libexecdir setup to $exec_prefix/lib
------------------------------------
Upstream libexecdir defaults to $exec_prefix/libexec. This directory is
not part of FHS 2.2, so we change it to $exec_prefix/lib (yes, it is
correct to set it to $exec_prefix/lib even for bi-arch platforms). Most
projects add package name to this path, so you most probably get what
FHS 2.2 expects.
tiran commentedon Sep 8, 2016
Can we close the ticket or is it still relevant?
smontanaro commentedon Sep 8, 2016
Not relevant to me.
On Sep 8, 2016 5:45 PM, "Christian Heimes" <report@bugs.python.org> wrote:
cmccabe commentedon Nov 8, 2017
When installing Python 3.6.3 from source on openSUSE Leap 42.2, this bug still occurs. Python cannot find the readline module, until you symlink $prefix/lib/python3.6/lib-dynload to $prefix/lib64/python3.6/lib-dynload.
vstinner commentedon Feb 12, 2020
I mark this issue as a duplicate of bpo-1294959.