gpt4 book ai didi

python - 无法使用 cfx run 运行我开发的 Firefox 插件

转载 作者:太空宇宙 更新时间:2023-11-03 18:29:59 25 4
gpt4 key购买 nike

我正在尝试使用此 tutorial 开始开发 Firefox 插件但出现以下问题

(c:\addon-sdk-1.15) C:\Users\Khaled\my-addon>cfx run
Using binary at 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'.
Using profile at 'c:\users\khaled\appdata\local\temp\tmph_o0ca.mozrunner'.
Traceback (most recent call last):
File "c:\addon-sdk-1.15\bin\cfx", line 33, in <module>
cuddlefish.run()
File "c:\addon-sdk-1.15\python-lib\cuddlefish\__init__.py", line 945, in run
pkgdir=options.pkgdir)
File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 705, in run_app

runner.start()
File "c:\addon-sdk-1.15\python-lib\mozrunner\__init__.py", line 532, in start
self.process_handler = run_command(self.command+self.cmdargs, self.env, **se
lf.kp_kwargs)
File "c:\addon-sdk-1.15\python-lib\mozrunner\__init__.py", line 59, in run_com
mand
return killableprocess.Popen(cmd, env=env, **killable_kwargs)
File "C:\Python27\lib\subprocess.py", line 709, in __init__
errread, errwrite)
TypeError: _execute_child() takes exactly 17 arguments (18 given)
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, in maybe_r
emove_outfile
os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-j8zqpd'
Error in sys.exitfunc:
Traceback (most recent call last):
File "C:\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, in maybe_r
emove_outfile
os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-j8zqpd'

我正在使用 python 2.6.6 并尝试了 2.7.6 出现了同样的问题...有什么建议吗?

最佳答案

搜索后我发现问题是:附加 SDK 与 python 2.7.6 不兼容,因此您必须使用 python 2.6.6 并在使用 python 2.6.6 时处理此错误

(c:\addon-sdk-1.15) C:\Users\Khaled\my-addon>cfx run
Traceback (most recent call last):
File "c:\addon-sdk-1.15\bin\cfx", line 33, in <module>
cuddlefish.run()
File "c:\addon-sdk-1.15\python-lib\cuddlefish\__init__.py", line 945, in run
pkgdir=options.pkgdir)
File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 639, in run_app

print >>sys.stderr, "Using binary at '%s'." % runner.binary
LookupError: unknown encoding: cp720
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, in maybe_r
emove_outfile
os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-ecam39'
Error in sys.exitfunc:
Traceback (most recent call last):
File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "c:\addon-sdk-1.15\python-lib\cuddlefish\runner.py", line 533, in maybe_r
emove_outfile
os.remove(outfile)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\khaled\\appdata\\local\\temp\\harness-stdou
t-ecam39'

解决方案:

1- 下载 cp720

2- 解压 zip 文件。

3- 将文件 cp720.py 复制或移动到您的 python 编码文件夹中。

 Example: C:\Python26\Lib\encodings\

关于python - 无法使用 cfx run 运行我开发的 Firefox 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22527573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com