linux下python2.7安装matplotlib出现问题显示:Collecting matplotlib
  Using cached https://files.pythonhosted.org/packages/32/6b/0368cfa5e1d1ae169ab7dc78addda3fd5e6262e48d7373a9114bac7caff7/matplotlib-2.2.4-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (2.8.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (2.4.0)
Requirement already satisfied: numpy>=1.7.1 in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (1.16.3)
Requirement already satisfied: pytz in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (2019.1)
Requirement already satisfied: backports.functools-lru-cache in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (1.5)
Requirement already satisfied: six>=1.10 in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (1.12.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from matplotlib) (0.10.0)
Collecting subprocess32 (from matplotlib)
  Using cached https://files.pythonhosted.org/packages/be/2b/beeba583e9877e64db10b52a96915afc0feabf7144dcbf2a0d0ea68bf73d/subprocess32-3.5.3.tar.gz
Collecting kiwisolver>=1.0.1 (from matplotlib)
  Using cached https://files.pythonhosted.org/packages/3a/62/a8c9bef3059d55ab38e41fe9cba4fad773bfc04e47290bab84db1c18262e/kiwisolver-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: setuptools in /usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages (from kiwisolver>=1.0.1->matplotlib) (36.4.0)
Building wheels for collected packages: subprocess32
  Building wheel for subprocess32 (setup.py) ... error
  Complete output from command /usr/local/src/Anaconda3/envs/py27/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-zEn9tS/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-_XFyd5 --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying subprocess32.py -> build/lib.linux-x86_64-2.7
  running build_ext
  running build_configure
  checking for gcc... no
  checking for cc... no
  checking for cl.exe... no
  configure: error: in `/tmp/pip-install-zEn9tS/subprocess32':
  configure: error: no acceptable C compiler found in $PATH
  See `config.log' for more details
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 120, in <module>
      main()
    File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 114, in main
      'Programming Language :: Python :: Implementation :: CPython',
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 179, in run
      self.run_command('build')
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/command/build.py", line 127, in run
      self.run_command(cmd_name)
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 41, in run
      self.run_command(command)
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 26, in run
      raise RuntimeError(configure_command + ' failed.')
  RuntimeError: sh ./configure failed.
  
  ----------------------------------------
  Failed building wheel for subprocess32
  Running setup.py clean for subprocess32
Failed to build subprocess32
Installing collected packages: subprocess32, kiwisolver, matplotlib
  Running setup.py install for subprocess32 ... error
    Complete output from command /usr/local/src/Anaconda3/envs/py27/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-zEn9tS/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ozzNT3/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying subprocess32.py -> build/lib.linux-x86_64-2.7
    running build_ext
    running build_configure
    checking for gcc... no
    checking for cc... no
    checking for cl.exe... no
    configure: error: in `/tmp/pip-install-zEn9tS/subprocess32':
    configure: error: no acceptable C compiler found in $PATH
    See `config.log' for more details
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 120, in <module>
        main()
      File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 114, in main
        'Programming Language :: Python :: Implementation :: CPython',
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/command/install.py", line 563, in run
        self.run_command('build')
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 41, in run
        self.run_command(command)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/local/src/Anaconda3/envs/py27/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-zEn9tS/subprocess32/setup.py", line 26, in run
        raise RuntimeError(configure_command + ' failed.')
    RuntimeError: sh ./configure failed.
    
    ----------------------------------------
Command "/usr/local/src/Anaconda3/envs/py27/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-zEn9tS/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ozzNT3/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-zEn9tS/subprocess32/

解决方法:

执行命令  yum groupinstall "Development Tools"

(py27) [root@master site-packages]# yum groupinstall "Development Tools"
 

详细如下:

https://stackoverflow.com/questions/19816275/no-acceptable-c-compiler-found-in-path-when-installing-python

Logo

更多推荐