PC: windows 11
wsl 2, ubuntu-22.04
PC:Windows 11 WSL 2,ubuntu-22.04
I was gonna install 'pwntools' by following these instructions
我打算按照这些说明安装'cnntools'
apt-get update
apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pwntools
after installing i tested it.
And this happened.
安装后,我对其进行了测试。这件事就发生了。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kimminjun514/.local/lib/python3.10/site-packages/pwn/__init__.py", line 4, in <module>
from pwn.toplevel import *
File "/home/kimminjun514/.local/lib/python3.10/site-packages/pwn/toplevel.py", line 23, in <module>
from pwnlib import *
File "/home/kimminjun514/.local/lib/python3.10/site-packages/pwnlib/dynelf.py", line 57, in <module>
from pwnlib import elf
File "/home/kimminjun514/.local/lib/python3.10/site-packages/pwnlib/elf/__init__.py", line 9, in <module>
from pwnlib.elf.corefile import Core
File "/home/kimminjun514/.local/lib/python3.10/site-packages/pwnlib/elf/corefile.py", line 79, in <module>
from elftools.common.py3compat import bytes2str
ModuleNotFoundError: No module named 'elftools.common.py3compat'
What's going on with my computer?
Do I have to buy a new computer?
我的电脑怎么了?我必须买一台新电脑吗?
I've tried a lot of things.
I deleted WSL and reinstalled it.
But that didn't work.
我试过很多方法。我删除了WSL并重新安装了它。但这并没有奏效。
I've googled thousand of times but i'm still stuck with this problem.
我已经用谷歌搜索了上千次,但我仍然被这个问题困扰着。
更多回答
Seems to be a known issue. I found that by searching for "py3compat" in the repo. I have no experience with this library myself, but the error makes it seem like a bug: dependency issue at runtime instead of at install-time. And just to be clear, there's no earthly reason you'd need to buy a new computer to fix an issue with a Python library.
这似乎是一个已知的问题。我在回购中搜索“py3compat”时发现了这一点。我自己没有使用这个库的经验,但这个错误让它看起来像是一个错误:在运行时而不是在安装时出现依赖问题。需要说明的是,你根本没有理由需要购买一台新计算机来解决一个与Python库有关的问题。
优秀答案推荐
Check whether the version of pyelftools
is 0.30
, after the test, the version of 0.29
will not report errors, so choose to uninstall the current version and replace the old version
检查是否为0.30,测试后0.29的版本不会上报错误,所以选择卸载当前版本并替换旧版本
pip uninstall pyelftools -y
pip install pyelftools==0.29
I hope you found this useful!
我希望你会觉得这很有用!
更多回答
This command, when I copied and pasted it, uninstalled pip! Found existing installation: pyelftools 0.30 Uninstalling pyelftools-0.30: Successfully uninstalled pyelftools-0.30 Found existing installation: pip 21.3.1 Uninstalling pip-21.3.1: Successfully uninstalled pip-21.3.1
当我复制和粘贴它时,这个命令卸载了pip!找到现有安装:pyelftools 0.30正在卸载pyelftools-0.30:已成功卸载pyelftools-0.30已找到现有安装:pip 21.3.1正在卸载pip-21.3.1:已成功卸载pip-21.3.1
Downgrading to 0.29 helped.
评级下调至0.29有所帮助。
我是一名优秀的程序员,十分优秀!