I found that flex was crashing when trying to build the binutils dependency which exists in the dependency chain of the py-yt package. This was fixed by getting a newer version of flex.
I further found that development of flex is currently not being done from sourceforge any more. New versions are released on github under a new release naming scheme. I've adjusted the url locations, added a new function to handle the new and old naming schemes, and added two new versions of flex.
#2384 contains the commit with the necessary changes.
This PR was created by the suggestion of @davydden in #2320.