简体   繁体   English

Windows Python2.7路径解析错误

[英]Windows Python2.7 path parsing error

I'm attempting to use the python 010 editor template parser 我正在尝试使用python 010编辑器模板解析器

The doc specifically states (to get started): 该文档特别指出(开始使用):

import pfp
pfp.parse(data_file="C:\path2File\file.SWF",template_file="C:\path2File\SWFTemplate.bt")

However, it throws: 但是,它抛出:

RuntimeError: Unable to invoke 'cpp'. Make sure its path was passed correctly
Original error: [Error 2] The system cannot find the file specified

I've tried everything, from using raw strings: 我已经尝试了一切,从使用原始字符串开始:

df = r"C:\path2File\file.swf"
tf = r"C:\path2File\SWFTemplate.bt"

To single and then double '\\'s or '/'s in the string. 要对字符串中的'\\'或'/'进行单选然后再使其加倍。 However, it keeps throwing the above error message. 但是,它不断抛出上述错误信息。

I checked the files are in the path and ensured everything is properly spelled, case sensitively. 我检查了文件是否在路径中,并确保所有内容均正确拼写,区分大小写。

To test my paths, I've used the windows "type" (equiv to *nix strings) and passed the strings as args in a subprocess.Popen which worked. 为了测试我的路径,我使用了Windows的“类型”(相当于* nix字符串),并在工作的subprocess.Popen中将这些字符串作为args传递了。

The problem is that it's trying to invoke a C++ compiler: cpp and you don't have one. 问题在于它正在尝试调用C ++编译器: cpp而您没有。

You'll need to install one, or make sure that your PATH has a cpp.exe on it somewhere. 您需要安装一个,或确保PATH上的某个位置有cpp.exe

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

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