Error installing Firefox Addon SDK Python

Hi, I’m trying to figure out how to install the Firefox Addon SDK correctly, I completed all the installation details, such as: Installing Python 2.7, setting up the PATH variables correctly and starting the addon from my cmd.exe .. Everytime I run the command line to start developing the addon . I get this error:

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

Ifrom my understanding I have everything correctly configured, can anyone help with this error. And also my PATH variables are below

   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
+4
source share
5 answers

, PYTHONINSTALL. , Mozilla, .

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
+8

, , python .

  • , python version 2.5, 2.6 or 2.7. 3.x Python .
  • Python C:/Python32/.
  • addon-sdk bin\activate.
+4

2015 , , Firefox Addon SDK, , - Windows, Python ...

, v2.7 Python

111 activate.bat :

set PYTHONINSTALL=%PYTHONINSTALL:REG_SZ=%

set PYTHONINSTALL=%PYTHONINSTALL:REG_SZ="C://Python27"

, Python. !

+2

Windows 7, , , .

, , , !

+1

(), -, Windows:

  • REG_SZ , . ?. (. )
  • char, , 2 2-, .
  • , , .

: , . , : |, <, > .. , .

:

if exist %PYTHONINSTALL%\whatever goto :EOF

, , .

, , , . HKML:

rem Try HKLM
SET QueryResult=
FOR /F "usebackq delims=" %%r IN (`%reg% QUERY HKLM\%key% /ve 2^>NUL`) DO @SET QueryResult=%%r

SET ReplacedResult=%QueryResult:REG_SZ=?%
FOR /F "tokens=2 delims=?" %%t IN ("%ReplacedResult%") DO SET "%~1=%%t"

rem trim tabs and spaces from the left (note: there a literal tab in next line)
FOR /F "tokens=* delims=     " %%v IN ("%PYTHONINSTALL%") DO SET PYTHONINSTALL=%%v

if exist "%PYTHONINSTALL%\python.exe" goto :EOF
rem It may be a 32bit Python directory built from source, in which case the
rem executable is in the PCBuild directory.
if exist "%PYTHONINSTALL%\PCBuild\python.exe" (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild" & goto :EOF)
rem Or maybe a 64bit build directory.
if exist "%PYTHONINSTALL%\PCBuild\amd64\python.exe" (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild\amd64" & goto :EOF)

, Github commit, diff.

0

Source: https://habr.com/ru/post/1535092/


All Articles