7

i need to install Python3 with ssl in a different userdir. I'm working on Debian without root privileges. I'm really trying to find a solution by myself, but after spending serveral hours I'm still not able to get it correctly done.

The Path to install ssl and python is $HOME/.local/

$HOME is always an absolute path like /path/to/install

Logs below

Things I've already tried:

1. Creating installation folders

cd $HOME mkdir .local cd .local mkdir ssl mkdir python mkdir src cd src 

2. Downloading latest tar versions of Python and openssl

wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz tar xvfz Python-3.8.1.tgz tar xvfz openssl-1.1.1d.tar.gz 

3. Configure, Make, Install Openssl (in $HOME/.local/ssl)

cd openssl-1.1.1d ./config --prefix=$HOME/.local/ssl make && make install 

4. Edit Modules/Setup, Make, Install Python

cd $HOME/.local/src/Python-3.8.1 cd Modules vi Setup 

Modules/Setup

210 SSL=$HOME/.local/ssl 211 _ssl _ssl.c \ 212 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ 213 -L$(SSL)/lib -lssl -lcrypto 

configure

cd $HOME/.local/src/Python-3.8.1 ./configure --prefix=$Home/.local/python 

Log-Snippets

Configure Python

checking for openssl/ssl.h in /usr/local/ssl... no checking for openssl/ssl.h in /usr/lib/ssl... no checking for openssl/ssl.h in /usr/ssl... no checking for openssl/ssl.h in /usr/pkg... no checking for openssl/ssl.h in /usr/local... no checking for openssl/ssl.h in /usr... no checking whether compiling and linking against OpenSSL works... no 

Alternative Log: Seems it doesn't look in the right places. Already tried to give a hint while configure

./configure --prefix=$Home/.local/python --with-openssl=$HOME/.local/ssl 

Log while Configure Changes in:

checking for openssl/ssl.h in $HOME/.local/ssl... yes checking whether compiling and linking against OpenSSL works... yes checking for X509_VERIFY_PARAM_set1_host in libssl... yes checking for --with-ssl-default-suites... python 

But then make throws error

Include/internal -I. -I./Include -DPy_BUILD_CORE \ -DGITVERSION="\"`LC_ALL=C `\"" \ -DGITTAG="\"`LC_ALL=C `\"" \ -DGITBRANCH="\"`LC_ALL=C `\"" \ -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Python/frozen.o Python/frozen.c rm -f libpython3.8.a ar rcs libpython3.8.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o Modules/_ssl.o Modules/xxsubtype.o Python/frozen.o gcc -pthread -L$HOME/.local/ssl/lib -L$HOME/htdocs/.local/ssl/lib -Xlinker -export-dynamic -o python Programs/python.o libpython3.8.a -lcrypt -lpthread -ldl -lutil -lm -L$HOME/.local/ssl/lib -lssl -lcrypto -lm ./python -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi ./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory generate-posix-vars failed Makefile:592: recipe for target 'pybuilddir.txt' failed make: *** [pybuilddir.txt] Error 1 

Guess the Error occurs because of following line

./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Has somebody a clue where libssl.so.1.1 is supposed to be?

Thanks in advance.

Wip

1 Answer 1

4

Solved Issue by adding Path to LD_LIBRARY_PATH

Needed Libs can be found in path/to/ssl/lib

For me adding following Line in .profiles or .bashrc fixed the Issue

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/ssl/lib 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.