安装spams
1、尝试方法1
使用python对WSI(病理图像)进行预处理的时候,使用颜色标准化工具需要spams
但是使用pip install 安装很可能会出现失败。pip install spams 失败;这时采用python setup.py install
又报错了
No module named ‘numpy.distutils._msvccompiler’ in numpy.distutils; trying from distutils
根据这篇博客:link.
我下载安装了Visual Studio 生成工具 2019
链接: link.
现在正在安装
安装好了!然后我这个*直接点了重启!神奇的是重启完之后这篇文章还在~没有白记录
emmmm并没有用
2、尝试方法2
后来我一想是不是因为我本来安装的VS2015?
下载链接: link.
额还是不行, 这时候我已经疯了…
3、尝试方法3
参考文章: link.
结果…
找到这么多,我也不知道是哪个文件夹就都给添加进去了;
试了一下放在第一个文件夹是对的.
结果安装文件又报错了
参考文章: link.
还是报错,心累…
4、尝试方法4
根据这篇文章:link
下载安装gcc,g++编译器
接着点:link
这里
换了好几遍还是失败了.
重启pycharm可以 ~
在setup.py中插入以下代码:
import os
from distutils.sysconfig import get_config_vars
(opt,) = get_config_vars('OPT')
os.environ['OPT'] = " ".join(
flag for flag in opt.split() if flag != '-Wstrict-prototypes'
)
额…没有用
running install
running build
running build_py
running build_ext
building '_spams_wrap' extension
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
compile options: '-D__MSVCRT_VERSION__=0x1916 -I. -Ispams\linalg -Ispams\prox -Ispams\decomp -Ispams\dictLearn -IC:\4Software\Anaconda3\envs\tf\lib
\site-packages\numpy\core\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\Library\include -IC:\4Software\Anaconda3\envs\t
f\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\envs\tf\include -c'
extra options: '-DNDEBUG -DUSE_BLAS_LIB -fPIC -fopenmp -Wunused-variable -m64'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1916 -I. -Ispams\linalg -Ispams\prox -Ispams\decomp -Ispams\dictLear
n -IC:\4Software\Anaconda3\envs\tf\lib\site-packages\numpy\core\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\Library\i
nclude -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\envs\tf\include -c spams_wrap.cpp
-o build\temp.win-amd64-3.8\Release\spams_wrap.o -DNDEBUG -DUSE_BLAS_LIB -fPIC -fopenmp -Wunused-variable -m64
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: sorry, unimplemented: 64-bit mode not compiled in
error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -D__MSVCRT_VERSION__=0x1916 -I. -Ispams\linalg -Ispams\prox -Ispams\decomp
-Ispams\dictLearn -IC:\4Software\Anaconda3\envs\tf\lib\site-packages\numpy\core\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Ana
conda3\Library\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\envs\tf\include -IC:\4Software\Anaconda3\envs\tf\include -
c spams_wrap.cpp -o build\temp.win-amd64-3.8\Release\spams_wrap.o -DNDEBUG -DUSE_BLAS_LIB -fPIC -fopenmp -Wunused-variable -m64" failed with exit s
tatus 1
想知道怎么安装啊啊啊啊啊