File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Source/UnrealEnginePython Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 22
33using UnrealBuildTool ;
44using System . IO ;
5+ using System . Collections . Generic ;
56
67public class UnrealEnginePython : ModuleRules
78{
@@ -157,7 +158,13 @@ public UnrealEnginePython(TargetInfo Target)
157158
158159 private string DiscoverPythonPath ( string [ ] knownPaths )
159160 {
160- foreach ( string path in knownPaths )
161+ // insert the PYTHONHOME content as the first known path
162+ List < string > paths = new List < string > ( knownPaths ) ;
163+ string environmentPath = System . Environment . GetEnvironmentVariable ( "PYTHONHOME" ) ;
164+ if ( ! string . IsNullOrEmpty ( environmentPath ) )
165+ paths . Insert ( 0 , environmentPath ) ;
166+
167+ foreach ( string path in paths )
161168 {
162169 string headerFile = Path . Combine ( path , "include" , "Python.h" ) ;
163170 if ( File . Exists ( headerFile ) )
You can’t perform that action at this time.
0 commit comments