Getting error when trying to install python

前端 未结 3 1117
面向向阳花
面向向阳花 2021-02-05 10:47

I have downloaded python-3.6.1.tar.xz. then I extracted it. There is a file README.rst. this is the instruction file. and has the instruction how to install.

On Unix, Li

相关标签:
3条回答
  • 2021-02-05 10:47

    zipimport.ZipImportError: can't decompress data; zlib not available

    You should install zlib1g-dev and change your configure step like this:

    ./configure --with-zlib=/usr/include
    

    Now, try this:

     make clean
     apt-get install zlib1g-dev
     ./configure --with-zlib=/usr/include
     ...
    

    You can read more in Configure and compile Python with Zlib

    0 讨论(0)
  • 2021-02-05 10:52

    When I was trying to install Python 3.7.3 through pyenv, I got this same error. It was solved by ensuring that I had the prerequisites to my operating system, with the following:

    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
    

    I found this in pyenv Common build problems, thanks to agibalov.

    0 讨论(0)
  • 2021-02-05 10:57

    On MacOS the issue is often that an XCode update has removed Zlib. Running the following will solve it:

    xcode-select --install
    
    0 讨论(0)
提交回复
热议问题