python安装pyhash遇到的问题,pip install pyhash,ERROR: Command errored out with exit status 1

pip install pyhash==0.9.3 :

ERROR: Command errored out with exit status 1:
     command: /usr/local/python3/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jrxu7aqx/pyhash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jrxu7aqx/pyhash/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-7knxrytu
         cwd: /tmp/pip-install-jrxu7aqx/pyhash/
    Complete output (47 lines):
    WARNING: The wheel package is not available.
    WARNING: The wheel package is not available.
    WARNING: The wheel package is not available.
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: /usr/local/python3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-mom1o5ix/py-cpuinfo/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-mom1o5ix/py-cpuinfo/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-qyp04urg
           cwd: /tmp/pip-wheel-mom1o5ix/py-cpuinfo/
      Complete output (6 lines):
      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: invalid command 'bdist_wheel'
      ----------------------------------------
      ERROR: Failed building wheel for py-cpuinfo
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/local/python3/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/local/python3/bin/python3.8', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpxru04ebv', '--quiet', 'py-cpuinfo']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "", line 1, in <module>
      File "/tmp/pip-install-jrxu7aqx/pyhash/setup.py", line 129, in <module>
        setup(name='pyhash',
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/__init__.py", line 143, in setup
        _install_setup_requires(attrs)
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/__init__.py", line 138, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/dist.py", line 695, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/usr/local/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 781, in resolve
        dist = best[req.key] = env.best_match(
      File "/usr/local/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1066, in best_match
        return self.obtain(req, installer)
      File "/usr/local/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1078, in obtain
        return installer(requirement)
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
        raise DistutilsError(str(e))
    distutils.errors.DistutilsError: Command '['/usr/local/python3/bin/python3.8', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpxru04ebv', '--quiet', 'py-cpuinfo']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

pip install pyhash :

   ERROR: Command errored out with exit status 1:
     command: /usr/local/python3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bb_r7c_9/pyhash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bb_r7c_9/pyhash/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-4z7cbj5s/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/python3/include/python3.8/pyhash
         cwd: /tmp/pip-install-bb_r7c_9/pyhash/
    Complete output (35 lines):
    WARNING: The wheel package is not available.
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/pyhash
    copying pyhash/__init__.py -> build/lib.linux-x86_64-3.8/pyhash
    /usr/local/python3/lib/python3.8/site-packages/setuptools/lib2to3_ex.py:39: SetuptoolsDeprecationWarning: 2to3 support is deprecated. If the project still requires Python 2 support, please migrate to a single-codebase solution or employ an independent conversion process.
      warnings.warn(
    Fixing build/lib.linux-x86_64-3.8/pyhash/__init__.py
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    Fixing build/lib.linux-x86_64-3.8/pyhash/__init__.py
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    running build_clib
    building 'fnv' library
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    creating build/temp.linux-x86_64-3.8/src/fnv
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -c src/fnv/hash_32.c -o build/temp.linux-x86_64-3.8/src/fnv/hash_32.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -c src/fnv/hash_32a.c -o build/temp.linux-x86_64-3.8/src/fnv/hash_32a.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -c src/fnv/hash_64.c -o build/temp.linux-x86_64-3.8/src/fnv/hash_64.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -c src/fnv/hash_64a.c -o build/temp.linux-x86_64-3.8/src/fnv/hash_64a.o
    ar rcs build/temp.linux-x86_64-3.8/libfnv.a build/temp.linux-x86_64-3.8/src/fnv/hash_32.o build/temp.linux-x86_64-3.8/src/fnv/hash_32a.o build/temp.linux-x86_64-3.8/src/fnv/hash_64.o build/temp.linux-x86_64-3.8/src/fnv/hash_64a.o
    building 'smhasher' library
    creating build/temp.linux-x86_64-3.8/src/smhasher
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -c src/smhasher/MurmurHash1.cpp -o build/temp.linux-x86_64-3.8/src/smhasher/MurmurHash1.o -msse4.2 -maes -mavx -mavx2
    gcc: error trying to exec 'cc1plus': execvp: No such file or directory
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/python3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bb_r7c_9/pyhash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bb_r7c_9/pyhash/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-4z7cbj5s/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/python3/include/python3.8/pyhash Check the logs for full command output.

解决办法:

yum install boost
yum install boost-devel
yum -y install gcc  
yum -y install gcc-c++  


解释:GCC(GNU Compiler Collection)是Linux下最主要的编译工具,GCC功能非常强大,结构也灵活。它可以通过不同的前端模块来支持各种语言,如Java、Fortran、Pascal、Modula-3和Ada。

在CentOS下,可以在联网状态下在线yum安装GCC,此种方式安装的GCC是4.8.5版本的,有时候已经不能满足需要。因此若需要可在此基础上自行进行升级。截止目前新版本,GCC 开始全面支持C 11和C++ 11的新特性。

其他:

yum -y install gcc
yum -y install gcc-c++ 
yum install make
 
或者
yum groupinstall "Development Tools"
 
或者
yum install gcc gcc-c++ kernel-devel

你可能感兴趣的:(Python相关,日常错误)