安装python在网上查了很多教程。
很多基本上第一句都是
sudo add-apt-repository ppa:jonathonf/python-3.6
或者是:
sudo add-apt-repository ppa:fkrull/deadsnakes
我马上迷惑了,「ppa:jonathonf」与「ppa:fkrull」什么区别,有的地方解释说是源不一样,我不太明白,没有找到具体相关解释,我又怕有问题,所以果断放弃了这种方法。
找到了另一种安装方法:
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
我看到了python.org这个地方,使我安心了很多,至少我明白这是个官网的意思。所以按照这个教程继续下去。下面是这个教程链接地址:
我千辛万苦的执行到了这一步,问题来了。
sudo make install
安装最后几行来了问题。
ipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
在百度上一查,说是缺少zlib相关依赖包。那只能下载安装。
我下载了这个压缩格式:Jean-loup Gailly包,并且也要安装。
屏幕快照 2018-05-27 18.29.38.png
1.tar -xvf zlib-1.2.11.tar.gz
2.cd zlib-1.2.11
3.make
4.sudo make install
我觉得我应该可以了,这个东西应该是安装好,可以进行下一步了。
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/site-packages
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages
我还是不太懂,这是成功了呀还是不成功呀,还是有问题呀,还是怎么了。我在研究研究啊,可喜的是至少和第一次安装不一样,这个没有错误。
网友评论