mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Append python Scripts directory to PATH env on windows
This commit is contained in:
parent
ba63b07a5e
commit
fe54a2ec0f
@ -136,7 +136,7 @@ wxString PATHS::GetDefault3rdPartyPath()
|
||||
|
||||
tmp.AppendDir( wxT( "3rdparty" ) );
|
||||
|
||||
return tmp.GetPath();
|
||||
return tmp.GetAbsolutePath();
|
||||
}
|
||||
|
||||
|
||||
|
@ -249,6 +249,19 @@ bool SCRIPTING::scriptingSetup()
|
||||
// Now initialize Python Home via capi
|
||||
Py_SetPythonHome( pyHome.GetFullPath().c_str() );
|
||||
}
|
||||
|
||||
// Allow executing the python pip installed scripts on windows easily
|
||||
wxString envPath;
|
||||
if( wxGetEnv( wxT( "PATH" ), &envPath ) )
|
||||
{
|
||||
wxFileName pythonThirdPartyBin( PATHS::GetDefault3rdPartyPath() );
|
||||
pythonThirdPartyBin.AppendDir( wxString::Format( wxT( "Python%d%d" ), PY_MAJOR_VERSION, PY_MINOR_VERSION ) );
|
||||
pythonThirdPartyBin.AppendDir( wxT( "Scripts" ) );
|
||||
|
||||
envPath = pythonThirdPartyBin.GetAbsolutePath() + ";" + envPath;
|
||||
|
||||
wxSetEnv( wxT( "PATH" ), envPath );
|
||||
}
|
||||
#else
|
||||
// Intended for msys2 but we could probably use the msvc equivalent code too
|
||||
// If our python.exe (in kicad/bin) exists, force our kicad python environment
|
||||
|
Loading…
x
Reference in New Issue
Block a user