Python Forum
Installing Python and pointing it to required libraries
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing Python and pointing it to required libraries
#1
Hello, more experienced people.

I am responsible for installing software on our CentOS cluster. Several users have requested a new Python version be installed, with extra packages. Sadly, I do not have access to the package management system, so I have to do everything by hand. (This does not mean I should not be able to install PIP and use it... I hope)

However, the first big problem is compiling Python itself. I have:

1) Downloaded Python 3.7.2 from https://www.python.org/downloads/source/

2) To get PIP to work I need _ctypes. To get Python to compile with _ctypes I need libffi, which I got from https://sourceware.org/libffi/ which configures and makes smoothly, and generates header file ffi.h, ffi_common.h and library libffi.so. So far so good.

3) I tried to configure Python using:

./configure --with-valgrind --with-libs='-L/trinity/opt/apps/software/libffi/libffi-3.2.1/x86_64-unknown-linux-gnu/.libs -lffi'
as the with-libs argument comes back into the configure log in compile commands such as [snippet from config.log]:

configure:10917: gcc -pthread -o conftest conftest.c
-L/trinity/opt/apps/software/libffi/libffi-3.2.1/x86_64-unknown-linux-gnu/.libs -lffi -lpthread
-ldl >&5
4) Also I hardcoded the path to the header file in the configure script, which I know is ugly, but I saw no way to provide it as an argument.

LIBFFI_INCLUDEDIR="/trinity/opt/apps/software/libffi/libffi-3.2.1/x86_64-unknown-linux-gnu/include"
5) Now I can make, and I am still stuck with the issue that libffi cannot be found, so my efforts to point Python to its location were wrong... (Also a bunch of other misery, but that is another day's worries) :

Error:
running build running build_ext INFO: Can't locate Tcl/Tk libs and/or headers INFO: Could not locate ffi libs and/or headers Python build finished successfully! The necessary bits to build these optional modules were not found: _bz2 _curses _curses_panel _hashlib _lzma _sqlite3 _ssl _tkinter _uuid readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Failed to build these modules: _ctypes Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
What is the best way to indicate the locations of required libraries and header files?
What probably obvious mistake did I make?

Thank you for your time and expertise!
Reply
#2
I found the path to the light myself.
I managed to install Anaconda3, with a modern Python in it and an ocean of extra packages. It did not require root privileges and pip and lidffi are in it. :)

Cheers!
Lukas
Reply
#3
Hand If you din't use sudo for your installation, will all users have access to the libs?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding libraries to embedded Python as a ZIP The_Oman 0 1,224 May-05-2023, 04:05 PM
Last Post: The_Oman
  "SUMIF" type query in Python (help required) BlainEillimatta 0 851 Oct-06-2022, 09:08 AM
Last Post: BlainEillimatta
Question Trouble installing modules/libraries and getting Notepad++ to show cyrillic letters Dragiev 6 2,241 Jul-24-2022, 12:55 PM
Last Post: Dragiev
  Python script with local libraries zazas321 0 967 Jul-05-2022, 04:55 AM
Last Post: zazas321
  python 3: TypeError: a bytes-like object is required, not 'str' wardancer84 3 6,477 Jul-09-2021, 05:55 PM
Last Post: deanhystad
  Sorting Elements via parameters pointing to those elements. rpalmer 3 2,585 Feb-10-2021, 04:53 PM
Last Post: rpalmer
  Package python script which has different libraries as a single executable or script tej7gandhi 1 2,618 May-11-2019, 08:12 PM
Last Post: keames
  Why is this pointing to the objects hshivaraj 6 2,822 Apr-09-2019, 10:55 PM
Last Post: hshivaraj
  Installing libraries wendysling 3 3,754 Mar-25-2019, 04:57 PM
Last Post: wendysling
  What are ways of pointing cross-compiled origin source line for python? wyvogew 2 2,810 Feb-02-2019, 03:16 PM
Last Post: wyvogew

Forum Jump:

User Panel Messages

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