ExGUtils 3.0 無法安裝

  • 本文关键字:ExGUtils python pip
  • 更新时间 :
  • 英文 :


你好,我正试图在我的windows计算机上的VS代码上安装我的python环境中的ExGUtils 3.0。我一直得到这样的错误:

Collecting ExGUtils
Using cached ExGUtils-3.0.tar.gz (377 kB)
ERROR: Command errored out with exit status 1:
command: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_c5150aa0bfa44ea89ce16af14a8507f3\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_c5150aa0bfa44ea89ce16af14a8507f3\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:UsersLeoAppDataLocalTemppip-pip-egg-info-8ujlwys6'
cwd: C:UsersLeoAppDataLocalTemppip-install-0sbakymgexgutils_c5150aa0bfa44ea89ce16af14a8507f3
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersLeoAppDataLocalTemppip-install-0sbakymgexgutils_c5150aa0bfa44ea89ce16af14a8507f3setup.py", line 29, in <module>
bla = raw_input("Compile C [Y/n]? ")
NameError: name 'raw_input' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/af/e7/006322dd2e5d3644ac14b1e49c6c77bf1836598eacfb36ef2a96c85b85b3/ExGUtils-3.0.tar.gz#sha256=413cd9f84a8bbff9c1cee1388775a5cd9c7545e6bfb28502d988cf6b2de0515e (from https://pypi.org/simple/exgutils/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached ExGUtils-2.0.tar.gz (873 kB)
Building wheels for collected packages: ExGUtils
Building wheel for ExGUtils (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_ed75e0edba84415a97393b42b74dfabb\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_ed75e0edba84415a97393b42b74dfabb\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'"'"'))' bdist_wheel -d 'C:UsersLeoAppDataLocalTemppip-wheel-q2fegjyw'
cwd: C:UsersLeoAppDataLocalTemppip-install-0sbakymgexgutils_ed75e0edba84415a97393b42b74dfabb
Complete output (11 lines):
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9ExGUtils
copying ExGUtilspyexg.py -> buildlib.win-amd64-3.9ExGUtils
copying ExGUtils__init__.py -> buildlib.win-amd64-3.9ExGUtils
running build_ext
building 'ExGUtils.uts' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for ExGUtils
Running setup.py clean for ExGUtils
Failed to build ExGUtils
Installing collected packages: ExGUtils
Running setup.py install for ExGUtils ... error
ERROR: Command errored out with exit status 1:
command: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_ed75e0edba84415a97393b42b74dfabb\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_ed75e0edba84415a97393b42b74dfabb\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'"'"'))' install --record 'C:UsersLeoAppDataLocalTemppip-record-bwzox5tuinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvincludesitepython3.9ExGUtils'
Complete output (11 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9ExGUtils
copying ExGUtilspyexg.py -> buildlib.win-amd64-3.9ExGUtils
copying ExGUtils__init__.py -> buildlib.win-amd64-3.9ExGUtils
running build_ext
building 'ExGUtils.uts' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_ed75e0edba84415a97393b42b74dfabb\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-0sbakymg\exgutils_ed75e0edba84415a97393b42b74dfabb\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'"'"'))' install --record 'C:UsersLeoAppDataLocalTemppip-record-bwzox5tuinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvincludesitepython3.9ExGUtils' Check the logs for full command output.
WARNING: You are using pip version 21.1.3; however, version 21.3 is available.
You should consider upgrading via the 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe -m pip install --upgrade pip' command.
(.venv) PS C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace> python -m pip install ExGUtils
Collecting ExGUtils
Using cached ExGUtils-3.0.tar.gz (377 kB)
ERROR: Command errored out with exit status 1:
command: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_cea064063ecb48eda3e03df6cf8186f9\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_cea064063ecb48eda3e03df6cf8186f9\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:UsersLeoAppDataLocalTemppip-pip-egg-info-w1hiuf8f'
cwd: C:UsersLeoAppDataLocalTemppip-install-da5a3nfvexgutils_cea064063ecb48eda3e03df6cf8186f9
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersLeoAppDataLocalTemppip-install-da5a3nfvexgutils_cea064063ecb48eda3e03df6cf8186f9setup.py", line 29, in <module>
bla = raw_input("Compile C [Y/n]? ")
NameError: name 'raw_input' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/af/e7/006322dd2e5d3644ac14b1e49c6c77bf1836598eacfb36ef2a96c85b85b3/ExGUtils-3.0.tar.gz#sha256=413cd9f84a8bbff9c1cee1388775a5cd9c7545e6bfb28502d988cf6b2de0515e (from https://pypi.org/simple/exgutils/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached ExGUtils-2.0.tar.gz (873 kB)
Building wheels for collected packages: ExGUtils
Building wheel for ExGUtils (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_15bec1f8cd874388bebb08e44962e7dc\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_15bec1f8cd874388bebb08e44962e7dc\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'"'"'))' bdist_wheel -d 'C:UsersLeoAppDataLocalTemppip-wheel-7hbbnzp9'
cwd: C:UsersLeoAppDataLocalTemppip-install-da5a3nfvexgutils_15bec1f8cd874388bebb08e44962e7dc
Complete output (11 lines):
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9ExGUtils
copying ExGUtilspyexg.py -> buildlib.win-amd64-3.9ExGUtils
copying ExGUtils__init__.py -> buildlib.win-amd64-3.9ExGUtils
running build_ext
building 'ExGUtils.uts' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for ExGUtils
Running setup.py clean for ExGUtils
Failed to build ExGUtils
Installing collected packages: ExGUtils
Running setup.py install for ExGUtils ... error
ERROR: Command errored out with exit status 1:
command: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_15bec1f8cd874388bebb08e44962e7dc\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_15bec1f8cd874388bebb08e44962e7dc\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'"'"'))' install --record 'C:UsersLeoAppDataLocalTemppip-record-9piz1prwinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvincludesitepython3.9ExGUtils'
cwd: C:UsersLeoAppDataLocalTemppip-install-da5a3nfvexgutils_15bec1f8cd874388bebb08e44962e7dc
Complete output (11 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9ExGUtils
copying ExGUtilspyexg.py -> buildlib.win-amd64-3.9ExGUtils
copying ExGUtils__init__.py -> buildlib.win-amd64-3.9ExGUtils
running build_ext
building 'ExGUtils.uts' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvScriptspython.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_15bec1f8cd874388bebb08e44962e7dc\setup.py'"'"'; __file__='"'"'C:\Users\Leo\AppData\Local\Temp\pip-install-da5a3nfv\exgutils_15bec1f8cd874388bebb08e44962e7dc\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'"'"'))' install --record 'C:UsersLeoAppDataLocalTemppip-record-9piz1prwinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersLeoDocumentsPython setup VSCodePythonWorkSpace.venvincludesitepython3.9ExGUtils' Check the logs for full command output.

我知道问题是我正在使用python 3,其中raw_input现在是input,我不确定如何解决这个问题,并希望我能得到任何帮助。我能想到的唯一解决方案是为Python 2创建一个新的环境,还有其他方法来解决这个问题吗?

正如您已经注意到的,这个包似乎是在编写时考虑到python 2x的。由于这个库非常小,您可以简单地从pypi下载源代码,提取它并在setup.py:

中编辑这行代码。
bla = raw_input("Compile C [Y/n]? ")

使其与python3兼容。然后在源代码目录下运行python setup.py install

请注意,你有一个额外的错误:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

如果你想安装这个库的C后端(可选),你需要确保你安装了它。

我跳过了输入对话框,通过注释它并添加:

bla = "Y"

我试着安装它,但是我的clang编译器在它的c代码上吐槽了。

ExGUtils/csources/_Uts.c:208:11: error: call to undeclared function 'Py_InitModule3'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

必须这样做"_uts.c"让它工作

/* Deprecated
PyMODINIT_FUNC inituts(void) {
PyObject* mod;
// Create the module
mod = Py_InitModule3("uts", module_methods, utils_docstring);
if (mod == NULL) {
return;
}
}
*/
static struct PyModuleDef Combinations =
{
PyModuleDef_HEAD_INIT,
"uts",                          /* name of module */
utils_docstring,                /* module documentation, may be NULL */
-1,                         /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
module_methods
};
PyMODINIT_FUNC PyInit_Combinations(void)
{
return PyModule_Create(&Combinations);
}

最新更新