20tab / UnrealEnginePython

Embed Python in Unreal Engine 4
MIT License
2.72k stars 742 forks source link

can not install from sources on win10 with unreal engine 4.18 #427

Open husha1993 opened 6 years ago

husha1993 commented 6 years ago

Hi, I followed the instructions here to install from sources on win10 with unreal engine 4.18, https://github.com/20tab/UnrealEnginePython#installation-from-sources-on-windows-64-bit, the attached are the errors when building: 1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------ 2>------ Build started: Project: UrbanCity, Configuration: Development_Editor x64 ------ 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.cpp.props (31,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\Intermediate\ProjectFiles\UE4.vcxproj] 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.cpp.props (31,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\Intermediate\ProjectFiles\UrbanCity.vcxproj] 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.cpp.props (31,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\Intermediate\ProjectFiles\UE4.vcxproj] 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.cpp.props (31,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\Intermediate\ProjectFiles\UrbanCity.vcxproj] 2>Performing 3 actions (4 in parallel) 2>UnrealEnginePython.cpp 2>C:\Program Files\Epic Games\UE_4.18\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(34): error C2440: 'initializing': cannot convert from 'void ' to 'char ' 2>C:\Program Files\Epic Games\UE_4.18\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(34): note: Conversion from 'void' to pointer to non-'void' requires an explicit cast 2>C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\Plugins\UnrealEnginePython\Source\UnrealEnginePython\Private\UnrealEnginePython.cpp(530): note: see reference to function template instantiation 'void FMsg::Logf_Internal<char>(const ANSICHAR ,int32,const FName &,ELogVerbosity::Type,const TCHAR ,T1)' being compiled 2> with 2> [ 2> T1=char * 2> ] 2>ERROR : UBT error : Failed to produce item: C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\Plugins\UnrealEnginePython\Binaries\Win64\UE4Editor-UnrealEnginePython.pdb 2>Total build time: 6.54 seconds (Local executor: 0.00 seconds) 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ""C:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" UrbanCityEditor Win64 Development "C:\Users\hushah\Desktop\UrbanCity_Unreal_python\UrbanCity\UrbanCity.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. 2>Done building project "UrbanCity.vcxproj" -- FAILED. ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have tried to comment the 530 line in UnrealEnginePython.cpp. While it was successfully build, the .uproject can not be launched in unreal engine, the screen shot are attached: buildbug

rdeioris commented 6 years ago

Hi, you should clone the latest code as it contains a fix for 4.18

husha1993 commented 6 years ago

Yes, I'm using the latest code and the above building error is from the latest code.

rdeioris commented 6 years ago

@husha1993 pull-again two dumb fixes were missing, sorry

husha1993 commented 6 years ago

Hi, The latest code is built successfully with the python path set as my anaconda environment in UnrealEnginePython.Build.cs. But the .uproject can not be launched in unreal engine, the error are the same as the screen shot attached above. I click 'debug the program', and the error is like this: buildbug

husha1993 commented 6 years ago

I thought it was related to the environment variables, so I restart my computer to make sure the path variable takes effects. But the .uproject still can not be launched in unreal engine. I click 'debug the program', and the error is like this: buildbug1

husha1993 commented 6 years ago

Finally I make it... I should set the python path as the base conda python path. Any user specific conda path failed.

Schizo commented 6 years ago

@husha1993 I think some people tumbled on similar issues. If you have time, it would be cool, if you could do a quick video tutorial. Especially people coming from linux would appreciate the steps on Windows.

husha1993 commented 6 years ago

Sorry about my late reply... I followed the instructions here: https://github.com/20tab/UnrealEnginePython#installation-from-sources-on-windows-64-bit

In order to use the anaconda python, I followed the instructions mentioned in the above link: "By default the build procedure will try to discover your python installation looking at hardcoded known paths. If you want to specify a custom python installation (or the autodetection simply fails) you can change it in the Source/UnrealEnginePython/UnrealEnginePython.Build.cs file at this line: https://github.com/20tab/UnrealEnginePython/blob/master/Source/UnrealEnginePython/UnrealEnginePython.Build.cs#L10"

I set the private string pythonHome = "C:/Program Files/Anaconda3";