altinstall error

11,791

Solution 1

I've just experienced the same issue with installing python3.7.3 on ubuntu18.04. Following this message and running:

sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev \
zlib1g-dev libssl-dev openssl libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev \
libncursesw5-dev libffi-dev uuid-dev

Allowed me to successfully run sudo make altinstall.

Solution 2

I had the same issue using Ubuntu and the two top answers did not work. I used the answer I got from https://github.com/pyenv/pyenv/wiki/common-build-problems and tried again and it worked. basically I did:

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

and then:

sudo make altinstall
Share:
11,791

Related videos on Youtube

plutesci
Author by

plutesci

Learner

Updated on September 18, 2022

Comments

  • plutesci
    plutesci almost 2 years

    Hello I have just install python as highlighted below there is an error for altinstall, should I use make install?

     ./configure
     make
     sudo make altinstall
    

    or

    ./configure
    make
    sudo make install
    

    I was following a tutorial and this was the error.

    File "/home/plutes/Downloads/Python-3.6.6rc1/Lib/ensurepip/__init__.py", line 117, in _bootstrap
        return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
      File "/home/plutes/Downloads/Python-3.6.6rc1/Lib/ensurepip/__init__.py", line 27, in _run_pip
        import pip._internal
    **zipimport.ZipImportError: can't decompress data; zlib not available
    Makefile:1113: recipe for target 'altinstall' failed
    make: *** [altinstall] Error 1**
    
    plutes@plutes-Lenovo-G50-30:~/Downloads/Python-3.6.6rc1$ cd
    
    plutes@plutes-Lenovo-G50-30:~$ python
    python             python3            python3.6m-config  python3m
    python2            python3.6          python3.7          
    python2.7          python3.6m         python3.7m         
    plutes@plutes-Lenovo-G50-30:~$ python3.6
    
    Python 3.6.6rc1 (default, Jun 17 2018, 21:36:49) 
    [GCC 7.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> help()
    
    Welcome to Python 3.6's help utility!
    
    as you can see it works, but I am unsure about future uses. thanks for any guidance.
    
    plutes@plutes-Lenovo-G50-30:~$ python3.6
    Python 3.6.6rc1 (default, Jun 17 2018, 21:36:49) 
    [GCC 7.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> print("Hello, World!")  
    Hello, World!
    >>> 
    
  • Manikandan Ram
    Manikandan Ram about 3 years
    Worked perfectly