──(root💀kali01)-[/home/dc/Desktop] └─# pip install gmpy2 ERROR: Could not find a version that satisfies the requirement gmpy2(from versions: none) ERROR: No matching distribution found for gmpy2 ┌──(root💀kali01)-[/home/dc/Desktop] └─# pip2 install gmpy2 1 ⨯ DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Collecting gmpy2 Downloading gmpy2-2.0.8.zip (280 kB) |████████████████████████████████| 280 kB 1.0 MB/s ERROR: Command errored out with exit status 1: command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-646jTE/gmpy2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-646jTE/gmpy2/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-mcHQge cwd: /tmp/pip-install-646jTE/gmpy2/ 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 'egg_info' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
2.执行pip3 install gmpy2
得到了想要的结果
┌──(root💀kali01)-[/home/dc/Desktop] └─# pip3 install gmpy2 1 ⨯ Collecting gmpy2 Using cached gmpy2-2.0.8.zip (280 kB) Building wheels for collected packages: gmpy2 Building wheel forgmpy2(setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/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 /tmp/pip-wheel-9swayh2v cwd: /tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/ Complete output(14 lines): running bdist_wheel running build running build_ext building 'gmpy2' extension creating build creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-euU3fN/python3.9-3.9.1=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-euU3fN/python3.9-3.9.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITHMPFR -DWITHMPC -I/usr/include/python3.9 -c src/gmpy2.c -o build/temp.linux-x86_64-3.9/src/gmpy2.o In file included from src/gmpy2.c:426: src/gmpy.h:252:12: fatal error: mpfr.h: No such file or directory 252 | # include "mpfr.h" | ^~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 ---------------------------------------- ERROR: Failed building wheel for gmpy2 Running setup.py clean for gmpy2 Failed to build gmpy2 Installing collected packages: gmpy2 Running setup.py install for gmpy2 ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/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'"'"'))' install --record /tmp/pip-record-9_0wm_0q/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/gmpy2 cwd: /tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/ Complete output(14 lines): running install running build running build_ext building 'gmpy2' extension creating build creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-euU3fN/python3.9-3.9.1=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-euU3fN/python3.9-3.9.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITHMPFR -DWITHMPC -I/usr/include/python3.9 -c src/gmpy2.c -o build/temp.linux-x86_64-3.9/src/gmpy2.o In file included from src/gmpy2.c:426: src/gmpy.h:252:12: fatal error: mpfr.h: No such file or directory 252 | # include "mpfr.h" | ^~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jgky7gnw/gmpy2_4bd9a6299dba4742852f6412aa414f89/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'"'"'))' install --record /tmp/pip-record-9_0wm_0q/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/gmpy2 Check the logs for full command output.
┌──(root💀kali01)-[/home/dc/Desktop] └─# pip3 install gmpy2 Requirement already satisfied: gmpy2 in /usr/local/lib/python3.9/dist-packages (2.0.8) WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv ┌──(root💀kali01)-[/home/dc/Desktop] └─# python3 Python 3.9.1+ (default, Feb 52021, 13:46:56) [GCC10.2.120210110] on linux Type"help", "copyright", "credits" or "license"for more information. >>> import gmpy2 >>> exit()
但是python2无法用:
┌──(root💀kali01)-[/home/dc/Desktop] └─# pip2 install gmpy2 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7is no longer maintained. pip 21.0 will drop support for Python 2.7in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Collecting gmpy2 Using cached gmpy2-2.0.8.zip (280 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3RFkaS/gmpy2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3RFkaS/gmpy2/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-xAzmXF cwd: /tmp/pip-install-3RFkaS/gmpy2/ 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 'egg_info' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.