新款MBP下的Python3安装pwntools包报错问题解决

最近新买了带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,就可以了 ,同类型问题使用相同方法解决。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卡尔哥哥好棒

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值