我一直在寻找无休止的论坛试图解决这个问题,但我仍然没有找到有效的答案。我是Windows的新手,我正在努力设置,因为我在Mac上有它们但命令行提出了挑战(什么相当于sudo?)例如,在Mac上我会键入'sudo pip install scrapy'什么是Windows上的等价物?我在下面收到此错误,我似乎无法找到解决方法。任何想法都非常感激。
C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes -Ic:\python27\include -Ic:\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win32-2.7\Release\src\lxml\lxml.etree.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Users\\kenma\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
creating users
creating users\kenma
creating users\kenma\appdata
creating users\kenma\appdata\local
creating users\kenma\appdata\local\temp
C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c /Fousers\kenma\appdata\local\temp\xmlXPathInitdw65bp.obj
xmlXPathInitdw65bp.c
c:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\kenma\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\kenma\\appdata\\local\\temp\\pip-build-c6lrhk\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\kenma\appdata\local\temp\pip-vhli1l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\kenma\appdata\local\temp\pip-build-c6lrhk\lxml\
答案 0 :(得分:1)
这似乎与@RequestMapping(path = "/attachmentPath", method = RequestMethod.POST)
public Response attachmentPath(HttpServletRequest request, Attachment attachment , @RequestParam(value = "file") MultipartFile file) throws IllegalStateException, IOException {
String orgName = file.getOriginalFilename();
String absolutePathToImages = request.getSession().getServletContext().getRealPath("/images/");
String filePath = absolutePathToImages + orgName;
File dest = new File(filePath);
//check destination exists, if not create it
if(!dest.exists())
{
new File(dest).mkdir();
}
try {
file.transferTo(dest);
}
catch (IllegalStateException e)
{
e.printStackTrace();
}
安装有关,这是一种scrapy依赖
官方documentation page有一些解决方案,但它建议在Windows操作系统中使用非官方二进制文件,可以在这里找到: