PS C:Usersuser> pip install getotp
Collecting getotp
Using cached getotp-0.0.3.tar.gz (3.4 kB)
ERROR: Command errored out with exit status 1:
command: 'c:usersuserappdatalocalprogramspythonpython39python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_f69bcd40d10d4267bbd1b13984d749e6\setup.py'"'"'; __file__='"'"'C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_f69bcd40d10d4267bbd1b13984d749e6\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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersuserAppDataLocalTemppip-pip-egg-info-umisjc6r'
cwd: C:UsersuserAppDataLocalTemppip-install-nrr48sljgetotp_f69bcd40d10d4267bbd1b13984d749e6
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersuserAppDataLocalTemppip-install-nrr48sljgetotp_f69bcd40d10d4267bbd1b13984d749e6setup.py", line 6, in <module>
execfile('getotp/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a2/dc/6d3cea111d7f77ee7bc222928c176b7d44d9478685e0d1496656be7259d6/getotp-0.0.3.tar.gz#sha256=acf785f72fafb431997f52c67c07645ca78d1c1e464fcc95a313b0649cf7ecd4 (from https://pypi.org/simple/getotp/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached getotp-0.0.2.tar.gz (3.4 kB)
ERROR: Command errored out with exit status 1:
command: 'c:usersuserappdatalocalprogramspythonpython39python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_3e06d6eb791c4df9a1f09d94a9717ef7\setup.py'"'"'; __file__='"'"'C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_3e06d6eb791c4df9a1f09d94a9717ef7\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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersuserAppDataLocalTemppip-pip-egg-info-q1vmndlz'
cwd: C:UsersuserAppDataLocalTemppip-install-nrr48sljgetotp_3e06d6eb791c4df9a1f09d94a9717ef7
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersuserAppDataLocalTemppip-install-nrr48sljgetotp_3e06d6eb791c4df9a1f09d94a9717ef7setup.py", line 6, in <module>
execfile('getotp/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fa/3d/43c5ad39ce25cfcbeb7bc41537c59c02ec8a06c10cd3592ef386038e23cb/getotp-0.0.2.tar.gz#sha256=5490fa2a61807d67b0010f0c9e2657a7866e8b026a7576101e5a3c5367a5a80a (from https://pypi.org/simple/getotp/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached getotp-0.0.1.tar.gz (3.2 kB)
ERROR: Command errored out with exit status 1:
command: 'c:usersuserappdatalocalprogramspythonpython39python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_e7a9683866eb4524b60b3692308caf48\setup.py'"'"'; __file__='"'"'C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_e7a9683866eb4524b60b3692308caf48\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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersuserAppDataLocalTemppip-pip-egg-info-9dl6hatg'
cwd: C:UsersuserAppDataLocalTemppip-install-nrr48sljgetotp_e7a9683866eb4524b60b3692308caf48
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersuserAppDataLocalTemppip-install-nrr48sljgetotp_e7a9683866eb4524b60b3692308caf48setup.py", line 6, in <module>
execfile('getotp/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/cd/0e/41efe822de7656c0f8874276e9e06a42e7b941b8029a7678f9cb71cbc03b/getotp-0.0.1.tar.gz#sha256=8199e2d6f3198ce14ee5d9af39f9e4bc581c9b67fb3bad4fb412773095531883 (from https://pypi.org/simple/getotp/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement getotp (from versions: 0.0.1, 0.0.2, 0.0.3)
ERROR: No matching distribution found for getotp
安装软件包时出现此错误
该包来自2014年,是为python2编写的。幸运的是,代码不是很长。您可以从pypi下载.tar.gz,也可以克隆github[repo](https://github.com/gmjosack/getotp]。然后手动遍历代码(或在每个.py文件上使用2to3
(,使其与python3兼容并运行
python setup.py install
当你完成。