Answered by @mahrez-benhamad in comments - it was a problem with the virtual environment itself. Switching to a later version solved the problem.