I\'ve install Python 3.4 and Python 3.6 on my local machine successfully, but am unable to install packages with pip3
.
When I execute pip3 install
Step by step guide to install Python 3.6 and pip3 in Ubuntu
Install the necessary packages for Python and ssl: $ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Download and unzip "Python-3.6.8.tar.xz" from https://www.python.org/ftp/python/ into your home directory.
Open terminal in that directory and run: $ ./configure
Build and install: $ make && sudo make install
Install packages with: $ pip3 install package_name
Disclaimer: The above commands are not tested in Ubuntu 20.04 LTS.
I was able to fix this by updating the python version in this file. pyenv: version `3.6.5' is not installed (set by /Users/taruntarun/.python-version) Though i had the latest version installed, my command was still using old version 3.6.5
Moving to version 3.7.3
(NOT on Windows!)
This made me tear my hair out for a week, so I hope this will help someone
I tried everything short of re-installing Anaconda and/or Jupyter.
Setup
./anaconda3/bin/python
)/usr/bin/python
and /usr/bin/python3
(but these were not being used as most of the work was done in Jupyter's terminal)Fix
In Jupyter's terminal:
cp /usr/lib64/libssl.so.10 ./anaconda3/lib/libssl.so.1.0.0
cp /usr/lib64/libcrypto.so.10 ./anaconda3/lib/libcrypto.so.1.0.0
What triggered this?
So, this was all working until I tried to do a conda install conda-forge
I'm not sure what happened, but conda must have updated openssl
on the box (I'm guessing) so after this, everything broke.
Basically, unknown to me, conda had updated openssl, but somehow deleted the old libraries and replaced it with libssl.so.1.1
and libcrypto.so.1.1
.
Python3, I guess, was compiled to look for libssl.so.1.0.0
In the end, the key to diagnosis was this:
python -c "import ssl; print (ssl.OPENSSL_VERSION)"
gave the clue library "libssl.so.1.0.0" not found
The huge assumption I made is that the yum
version of ssl is the same as the conda
version, so just renaming the shared object might work, and it did.
My other solution was to re-compile python, re-install anaconda, etc, but in the end I'm glad I didn't need to.
Hope this helps you guys out.
I had the same issue trying to install python3.7 on an ubuntu14.04 machine. The issue was that I had some custom folders in my PKG_CONFIG_PATH and in my LD_LIBRARY_PATH, which prevented the python build process to find the system openssl libraries.
so try to clear them and see what happens:
export PKG_CONFIG_PATH=""
export LD_LIBRARY_PATH=""