firefox - 安装 Firefox Addon SDK Python 时出错

标签 firefox python-2.7 windows-7 firefox-addon firefox-addon-sdk

您好,我正在尝试弄清楚如何正确安装 Firefox Addon SDK,我遵循了所有安装细节,例如:安装 Python 2.7,正确设置我的 PATH 变量,并从我的 cmd.exe 运行插件..每次我运行命令行开始开发插件我收到这个错误:

    C:\mozilla-build\addon-sdk\bin>activate.bat
    Warning: Failed to find Python installation directory

根据我的理解,我已经正确配置了所有内容,任何人都可以帮助解决此错误。而且我的 PATH 变量如下
   User Variables...;C:\mozilla-build\addon-sdk\bin;C:\mozilla-build\python;C:\Python27
   SYSTEM Variables ...;C:\mozilla-build\addon-sdk\bin;C:\mozilla-build\python;C:\Python27

最佳答案

问题似乎是激活批处理文件在设置变量 PYTHONINSTALL 的写入值时出现问题。
我通过手动设置它并删除所有用于检测路径的臃肿函数来解决这个问题。

使用编辑器打开 bin\activate.bat 文件(np++ 清楚地使用)
在 :CheckPython 标签下删除函数和注释并使用它来设置你的 python 安装路径:

:CheckPython
::CheckPython(retVal, key)
::Reads the registry at %2% and checks if a Python exists there.
::Checks both HKLM and HKCU, then checks the executable actually exists.

SET key=%2%
SET "%~1="
SET reg=reg
if defined ProgramFiles(x86) (

  if exist %WINDIR%\sysnative\reg.exe SET reg=%WINDIR%\sysnative\reg.exe
)
rem here you should make sure to set the correct path
set PYTHONINSTALL=C:\Program Files\Python27
if exist %PYTHONINSTALL%\python.exe goto :EOF

if exist %PYTHONINSTALL%\PCBuild\python.exe (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild" & goto :EOF)

if exist %PYTHONINSTALL%\PCBuild\amd64\python.exe (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild\amd64" & goto :EOF)



GOTO :EOF

关于firefox - 安装 Firefox Addon SDK Python 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22872082/

相关文章:

firefox - ExtJs5 - 覆盖 ext-all-debug.js 中定义的 native 方法

javascript - 检测用户何时单击链接但中止

c++ - Allegro 5 al_create_display(x, y) 不工作

vb.net - 如何在后台线程中运行代码并仍然访问UI?

c# - 如何以编程方式将文件夹添加到用户的收藏夹(在 Windows 资源管理器中)?

google-maps - 在 Firefox 下的 Google Maps API v3 中,通过拖动来平移 map 的速度很慢

linux - Firefox 附加组件在哪里可以找到 .xpi 文件

python manage.py runserver 没有名为 django.core.management 的模块

python - 无法在 Win7 上将 python.exe 设置为 *.py 脚本

python - django-social-auth - 缺少 HTTPSConnection