繁体   English   中英

"如何处理包安装错误?"

[英]How to handle package installation errors?

我正在尝试在 python 中安装一个名为“sparsesvd”的包,但出现以下错误:

Collecting sparsesvd
      Using cached https://files.pythonhosted.org/packages/65/d9/c2545987871e27cad5969799a1d45073321a2904ac4dcb18bc0f1fe16ecc/sparsesvd-0.2.2.tar.gz
    Requirement already satisfied: scipy>=0.6.0 in c:\users\saurabh\appdata\local\programs\python\python37\lib\site-packages (from sparsesvd) (1.2.1)
    Requirement already satisfied: cython in c:\users\saurabh\appdata\local\programs\python\python37\lib\site-packages (from sparsesvd) (0.29.6)
    Requirement already satisfied: numpy>=1.8.2 in c:\users\saurabh\appdata\local\programs\python\python37\lib\site-packages (from scipy>=0.6.0->sparsesvd) (1.16.2)
    Installing collected packages: sparsesvd
      Running setup.py install for sparsesvd: started
        Running setup.py install for sparsesvd: finished with status 'error'
        Complete output from command C:\Users\Saurabh\AppData\Local\Programs\Python\Python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Saurabh\\AppData\\Local\\Temp\\pycharm-packaging\\sparsesvd\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Saurabh\AppData\Local\Temp\pip-record-wd31zika\install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_ext
        No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
        cythoning sparsesvd.pyx to sparsesvd.c
        C:\Users\Saurabh\AppData\Local\Programs\Python\Python37\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\Saurabh\AppData\Local\Temp\pycharm-packaging\sparsesvd\sparsesvd.pxd
          tree = Parsing.p_module(s, pxd, full_module_name)
        warning: sparsesvd.pxd:7:31: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
        warning: sparsesvd.pxd:7:40: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
        building 'sparsesvd' extension
        error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

        ----------------------------------------

    Command "C:\Users\IronMaiden\AppData\Local\Programs\Python\Python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Saurabh\\AppData\\Local\\Temp\\pycharm-packaging\\sparsesvd\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Saurabh\AppData\Local\Temp\pip-record-wd31zika\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Saurabh\AppData\Local\Temp\pycharm-packaging\sparsesvd\

错误:Microsoft Visual C ++ 14.0是必需的。 使用“Microsoft Visual C ++构建工具”获取它: http//landinghub.visualstudio.com/visual-cpp-build-tools

你安装了吗?

编辑:原始链接不起作用。 试试这个: https//visualstudio.microsoft.com/visual-cpp-build-tools/

2022<\/strong> - 我的问题通过安装最新版本的 MS Visual Stdio 得到了解决。 不过,我没有任何充分的理由说明它为什么会起作用。

"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM