pip for python3.6.5 on debian9.4

帅比萌擦擦* 提交于 2019-12-11 05:07:44

问题


I recently Installed python3.6 on debian 9.4 by these commands

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar xvf Python-3.6.5.tgz
cd Python-3.6.5
./configure --enable-optimizations --with-ensurepip=install
make -j8
sudo make altinstall
python3.6

it worked when i type python3.6

but pip doesn't installed on python3.6 so i decided to install it manually by these commands

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3.6 get-pip.py

i get this error

Traceback (most recent call last):
  File "get-pip.py", line 20649, in <module>
    main()
  File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available

and then i installed zlib by typing

sudo apt-get install zlib1g

still it doesn't work What should i do to install pip on python3.6.5 on debian9.4 stable please help


回答1:


I actually installed it again by

sudo apt update
sudo apt upgrade

Next, install the default GCC toolchain with:

sudo apt install build-essential

Next, we need to install a few prerequisites for building Python:

sudo apt install libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev
sudo apt install libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev

At the time of this writing, the latest stable version of Python is 3.6.5, if you want to use a newer version change the next instructions accordingly:

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
tar xf Python-3.6.5.tar.xz
cd Python-3.6.5
./configure --enable-optimizations
make -j 8
sudo make altinstall

Once the above is finished, you could invoke the new Python interpreter with:

python3.6

Now everything is working!




回答2:


I faced with same problem. Try to type:

pip3.6


来源:https://stackoverflow.com/questions/51054281/pip-for-python3-6-5-on-debian9-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!