fix cython stuff
+import numpy
import sys
import os
+try: # add optional cython support
+ import pyximport
+except ImportError as e:
+ print(e)
+ pyximport = None
+
sys.path.append(os.path.abspath(os.path.dirname(__file__))) # ensure villager bot modules are accessible
os.chdir(os.path.dirname(__file__)) # ensure the current working directory is correct
-from karen import MechaKaren
+if pyximport:
+ # add cython support, with numpy header files
+ pyximport.install(language_level=3, reload_support=True, setup_args={"include_dirs": numpy.get_include()})
+ # import and compile villager bot cython modules here **first**
+ # if not all pyx files are imported here, each forked process / shard group will try to compile
+ # them and fail because they are all trying at the same time to access and write the same files
+ from util import blockifier
+
+from karen import MechaKaren
if __name__ == "__main__":
karen = MechaKaren()
