Python Forum
Libraries needed for python install?
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Libraries needed for python install?
#1
I'm getting the following when trying to install Python 3.6.2 on RHEL 6.7/ CentOS 6.7:
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_lzma                 _sqlite3              _ssl
_tkinter
To find the necessary bits, look in setup.py in detect_modules() for the module's name
So I look in setup.py, and find that I need sqlite3.h and ssl.h. However, it's not clear to me on which libraries for tkinter and lzma are needed. From setup.py:

        # LZMA compression support.
        if self.compiler.find_library_file(lib_dirs, 'lzma'):
            exts.append( Extension('_lzma', ['_lzmamodule.c'],
                                   libraries = ['lzma']) )
        else:
            missing.append('_lzma')
...
        # Call the method for detecting whether _tkinter can be compiled
        self.detect_tkinter(inc_dirs, lib_dirs)

        if '_tkinter' not in [e.name for e in self.extensions]:
            missing.append('_tkinter')
...
I'm trying to find which library files are needed, to find what RPMs I need to install. Any thoughts?
Reply
#2
I barely know CentOS but look for a package python3-tkinter. Also, you can try  to install openssl and openssl-devel/openssl-dev. Don't know haw the second package is called exactly. Installing sqlite3 should be ismple enough. Try with this name. Don't know for lzma. You could just try yum install lzma.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
I guess you have missing stuff in preparations of build essential tool.
This should cover the most,not tested.
# Start by making sure your system is up-to-date:
sudo yum update
sudo yum install yum-utils
sudo yum groupinstall development
# Libraries needed during compilation to enable all features of Python:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel

# pip to manage Python packages,and some development packages.
sudo yum install python36u-pip
sudo yum install python36u-devel
I have tutorial about pyenvhere,
it work also for CentOS makes it easy to install new Python versions,and also easier if want to try Anaconda,PyPy,Ironpython...ect.
Reply
#4
I get the following errors which prevent install when I run:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel
Output:
Error: Package: sqlite-devel-3.6.20-1.el6.x86_64 (RHEL6.7_ISO)
           Requires: sqlite = 3.6.20-1.el6
           Installed: sqlite-3.6.20-1.el6_7.2.i686 (@RHEL_UPDATES_2015)
               sqlite = 3.6.20-1.el6_7.2
           Available: sqlite-3.6.20-1.el6.i686 (RHEL6.7_ISO)
               sqlite = 3.6.20-1.el6
Error: Package: openssl-devel-1.0.1e-42.el6.x86_64 (RHEL6.7_ISO)
           Requires: openssl = 1.0.1e-42.el6
           Installed: openssl-1.0.1e-42.el6_7.2.i686 (@RHEL_UPDATES_2015)
               openssl = 1.0.1e-42.el6_7.2
           Available: openssl-1.0.1e-42.el6.i686 (RHEL6.7_ISO)
               openssl = 1.0.1e-42.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
It seems the python installer is looking for a slightly older version of the RPMs. As this python version is new and the RPM is for an older (but still supported) OS version, that doesn't make sense to me. Am I missing something here? Any thoughts on what I need to do to get past this problem?

Also, what repositories are python36u-pip and python36u-devel in? I haven't seen those before.
Reply
#5
Try with less not sure if all is needed.
Take look at Digital Ocean CentOS tutorial,there always start with a blank distro.

I always use pyenv to install new versions.
mint@mint ~ $ pyenv install 3.6.2
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
Installing Python-3.6.2...
Installed Python-3.6.2 to /home/mint/.pyenv/versions/3.6.2

# Make python and pip default to 3.6.2
mint@mint ~ $ pyenv global 3.6.2
Finish.
Reply
#6
I ended up getting our Satellite server updated with the latest RPMs, which solved my dependencies and this problem.
Reply
#7
If you just need a command to install all build dependencies, you can look into the pyenv wiki: https://github.com/pyenv/pyenv/wiki
There you'll have the overview for the most distributions also Cent Os:
  • CentOS/Fedora 21 and below:
FIXME: you may need to install xz to build some CPython version
yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#8
Thanks. I ended up getting the libraries I needed from the Satellite server. But I'll keep pyenv in mind.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding libraries to embedded Python as a ZIP The_Oman 0 1,239 May-05-2023, 04:05 PM
Last Post: The_Oman
  Python script with local libraries zazas321 0 976 Jul-05-2022, 04:55 AM
Last Post: zazas321
  Python issue - Data science - Help is needed yovel 2 2,016 Jul-29-2021, 04:27 PM
Last Post: yovel
  Help needed for a python package keysson 1 2,219 Sep-02-2020, 03:37 AM
Last Post: Larz60+
  Install libraries in Google Coral TPU hobbyist 1 2,042 Jul-13-2020, 09:57 PM
Last Post: DreamingInsanity
  Absolutely new to python - basic advise needed mariolucas75 2 2,067 Jun-12-2020, 08:36 PM
Last Post: Yoriz
Smile Help needed. Python Newbie!, it will be fun. knightdea 3 2,633 Oct-13-2019, 08:50 AM
Last Post: perfringo
  Installing Python and pointing it to required libraries hooiberg 2 4,321 May-13-2019, 05:55 PM
Last Post: ebolisa
  Package python script which has different libraries as a single executable or script tej7gandhi 1 2,635 May-11-2019, 08:12 PM
Last Post: keames
  help needed with python launcher fallenlight 3 3,378 Jan-19-2019, 01:06 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