JetBrains has provided an answer:
https://www.jetbrains.com/help/pycharm/2017.3/cython-speedups.html
If you’re on Ubuntu, run:
For Python 2.7: sudo apt-get install python-dev
For Python 3.5: sudo apt-get install python3-dev
For Python 3.6: sudo apt-get install python3.6-dev
For Python 3.7: sudo apt-get install python3.7-dev