CentOS installation Python3.x FAQ

  The version of Python that comes with CentOS 6.x is 2.6, and the version that comes with CentOS 7.x is 2.7. We have to install Python 3.X and configure the environment by ourselves, but the general installation process will not be smooth, and some errors are often reported. In CentOS and other Most of the reasons for the installation package installation errors in the Linux system are caused by the lack of dependency packages, and you need to deal with them yourself. The following are the common problems encountered when installing Python3:

1. Question 1:

  1. checking MACHDEP... linux  
  2. checking for --without-gcc... no  
  3. checking for --with-icc... no  
  4. checking for gcc... no  
  5. checking for cc... no  
  6. checking for cl.exe... no  
  7. configure: error: in `/usr/local/Python3/Python-3.6.5':  
  8. configure: error: no acceptable C compiler found in $PATH  
  9. See `config.log' for more details 

  When encountering the above error message, the prompt indicates that the gcc compilation environment is missing in this machine, and there are 2 solutions.

  1. Install the gcc compilation environment through yum: yum install -y gcc

  2. The yum function is not installed on this machine, you can download the gcc installation package: https://gcc.gnu.org/

  Re-execute the command after completion to add the configuration: ./configure --prefix=/usr/local/Pthon3  

  Then execute the command: make

2. Question 2:

  Execute the command: make, the following error message may appear: zipimport.ZipImportError: can't decompress data; zlib not available make: *** [install] Error 1 means that the system is caused by the lack of zlib related toolkits. If you know the problem, then We only need to install the relevant dependency packages,

  Solution: Open the terminal and enter the command to install the zlib related dependencies 

  yum -y install zlib*

  Continue to execute the command after completion: make install to install.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326106395&siteId=291194637