最近新买了带M1 Pro芯片的Macbook Pro,很多工具需要重新安装和配置,在用pip安装pwntools时,遇到了如下的报错信息(pwntools官网:Installation — pwntools 4.7.0 documentation,如果使用brew安装依赖包错误,直接拷贝 Alternate OSes的代码,然后在本地运行就可以)。直接复制报错信息,查了一些文章,没有解决,最后只能自己找办法。
错误信息截取如下:
Building wheel for unicorn (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zn/rm3m_q013psbv7wdfjxy8qdr0000gn/T/pip-install-d0lgwn8g/unicorn_d317b12a36ca4f019ccde552ede194cb/setup.py'"'"'; __file__='"'"'/private/var/folders/zn/rm3m_q013psbv7wdfjxy8qdr0000gn/T/pip-install-d0lgwn8g/unicorn_d317b12a36ca4f019ccde552ede194cb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/zn/rm3m_q013psbv7wdfjxy8qdr0000gn/T/pip-wheel-11j7l75_
cwd: /private/var/folders/zn/rm3m_q013psbv7wdfjxy8qdr0000gn/T/pip-install-d0lgwn8g/unicorn_d317b12a36ca4f019ccde552ede194cb/
Complete output (4 lines):
running bdist_wheel
running build
Building C extensions
error: [Errno 2] No such file or directory: '/private/var/folders/zn/rm3m_q013psbv7wdfjxy8qdr0000gn/T/pip-install-d0lgwn8g/unicorn_d317b12a36ca4f019ccde552ede194cb/../../include/unicorn'
----------------------------------------
ERROR: Failed building wheel for unicorn
红色的一大段不用关心,关注error部分:
Building wheel for unicorn (setup.py) ... error
是在安装unicorn依赖包的时候错误,单独安装unicorn就可以解决
python3 -m pip install unicorn
安装成功信息如下:
Defaulting to user installation because normal site-packages is not writeable
Collecting unicorn
Downloading unicorn-1.0.3.tar.gz (1.6 MB)
|████████████████████████████████| 1.6 MB 228 kB/s
Preparing metadata (setup.py) ... done
Building wheels for collected packages: unicorn
Building wheel for unicorn (setup.py) ... done
Created wheel for unicorn: filename=unicorn-1.0.3-py2.py3-none-macosx_10_14_arm64.whl size=6831371 sha256=84cf74d45f732137538dd43f83f92aa7c65ff97b58dc0b922644b9dc18463e93
Stored in directory: /Users/xxx/Library/Caches/pip/wheels/6c/81/de/0c77cdbad3c7333c513dac93367d72cedd39012eecc182ffb6
Successfully built unicorn
Installing collected packages: unicorn
Successfully installed unicorn-1.0.3
unicorn安装成功后重新运行pip来安装pwntools,就可以了 ,同类型问题使用相同方法解决。