Closed arafat0007 closed 4 years ago
I followed the below steps and it worked:
[Python] RelativeHome = Python35
Now relative path will be compared to our Content folder. Now i placed my python folder in Content. So If user changed place, it will always get the path of this python. Besides, i also changed that "C:/Python35" name, so that i can be sure, game is using this relative path python. If all is ok, i get result. If not then i get error.After running the game, i got the result of my python files. I moved whole game folder to various places so that it ensures that relative path was working. Also now that hard coded python path does not matter.
Though, I got into another problem.
import unreal_engine as ue testwidget = ue.get_asset("asset address")
I was trying to get asset but it was showing that "unreal_ue has no attribute named get_asset". But during gameplay, it was ok!!! After packaging, it is not working but in the gameplay, it works. Still i don't know why.
I am new to this and sorry if i made some errors while writing this. Please enlighten me if anyone has any correction or other way.
I haven't tested extensively but I used the instructions here and it seemed to work: https://github.com/20tab/UnrealEnginePython/issues/163#issuecomment-299550279
Basically:
I tested it by including a simple Python script that moves an actor around in the game and renaming the folder of my system-wide Python distribution so that it could not be found. The script works if I follow the instructions above, but it doesn't if I remove the embeddable Python distribution from that game executable folder, so I assume it's using the embeddable distribution. However, the real test would be to see if it works after coping to a machine that doesn't have any Python distribution installed, which I haven't tried yet.
Great works on this plugin!
I have been using python 3.5.2 and some other packages (pip, numpy,cv2,sklearn etc). For now i use hard coded python address (like C:/Python35) at UnrealEnginePython.Build.cs and of course after packaging they do not work.
I want to run python and those package on run-time and embed. Any follow through?