File tree Expand file tree Collapse file tree
Source/UnrealEnginePython Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -398,23 +398,25 @@ private string GetWindowsPythonLibFile(string basePath)
398398 // just for usability, report if the pythonHome is not in the system path
399399 string [ ] allPaths = System . Environment . GetEnvironmentVariable ( "PATH" ) . Split ( ';' ) ;
400400 // this will transform the slashes in backslashes...
401- string checkedPath = Path . GetFullPath ( basePath ) ;
402- if ( checkedPath . EndsWith ( "\\ " ) )
403- {
404- checkedPath = checkedPath . Remove ( checkedPath . Length - 1 ) ;
405- }
401+ string checkedPath = ! string . IsNullOrWhiteSpace ( basePath )
402+ ? new System . Uri ( Path . GetFullPath ( basePath ) . TrimEnd ( Path . DirectorySeparatorChar , Path . AltDirectorySeparatorChar ) ) . LocalPath
403+ : basePath ;
404+
406405 bool found = false ;
407406 foreach ( string item in allPaths )
408407 {
409- if ( item == checkedPath || item == checkedPath + "\\ " )
408+ string checkedItem = ! string . IsNullOrWhiteSpace ( item )
409+ ? new System . Uri ( item . TrimEnd ( Path . DirectorySeparatorChar , Path . AltDirectorySeparatorChar ) ) . LocalPath
410+ : item ;
411+ if ( checkedItem == checkedPath )
410412 {
411413 found = true ;
412414 break ;
413415 }
414416 }
415417 if ( ! found )
416418 {
417- System . Console . WriteLine ( "[WARNING] Your Python installation is not in the system PATH environment variable." ) ;
419+ System . Console . WriteLine ( "[WARNING] Your Python installation ({0}) is not in the system PATH environment variable." , checkedPath ) ;
418420 System . Console . WriteLine ( "[WARNING] Ensure your python paths are set in GlobalConfig (DefaultEngine.ini) so the path can be corrected at runtime." ) ;
419421 }
420422 // first try with python3
You can’t perform that action at this time.
0 commit comments