对于python的加密,可以参考 这里大致介绍了几种方法 https://www.cnblogs.com/dhcn/p/11077447.html
然后我选择了在windows下用cython打包成so的方法,具体又参考了 https://www.cnblogs.com/freeweb/p/6548208.html
一切准备好后则又出现了下面这个错误
(yolov5) D:\cell_detection>python setup1.py build
running build
running build_ext
building 'compute1' extension
error: Unable to find vcvarsall.bat
这个应该是没有找到windows下的编译器的原因 我又从这里开始安装window最新版本的Visual Studio 2022 community版 https://visualstudio.microsoft.com/zh-hans/downloads/
然后再次编译便成功了
C:\Users\Administrator\.conda\envs\yolov5\python.exe D:/cell_detection/setup1.py build
running build
running build_ext
building 'compute1' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Administrator\.conda\envs\yolov5\include -IC:\Users\Administrator\.conda\envs\yolov5\include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tccompute1.c /Fobuild\temp.win-amd64-3.7\Release\compute1.obj
compute1.c
creating D:\cell_detection\build\lib.win-amd64-3.7
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Administrator\.conda\envs\yolov5\libs /LIBPATH:C:\Users\Administrator\.conda\envs\yolov5\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.19041.0\\um\x64" /EXPORT:PyInit_compute1 build\temp.win-amd64-3.7\Release\compute1.obj /OUT:build\lib.win-amd64-3.7\compute1.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\compute1.cp37-win_amd64.lib
���?����� build\temp.win-amd64-3.7\Release\compute1.cp37-win_amd64.lib �?��� build\temp.win-amd64-3.7\Release\compute1.cp37-win_amd64.exp
�������?���
����?��������
|