我正在尝试在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\
答案 0 :(得分:0)
错误:需要Microsoft Visual C ++ 14.0。使用“ Microsoft Visual C ++生成工具”获取它:http://landinghub.visualstudio.com/visual-cpp-build-tools
您安装了吗?
编辑:原始链接不起作用。请尝试以下方法:https://visualstudio.microsoft.com/visual-cpp-build-tools/