I leave it here. Some time ago I experienced a similar error when I tried to compile my python project in IntelliJ IDEA. In my case, it was required to specify a custom Ant (check the Use custom Ant box) instead of the standard one. After I made these updates, everything worked fine. Please find the screenshot below. 
It worked for me, hope it will be useful.
Eugene t
source share