Skip to content

Instantly share code, notes, and snippets.

@dvigneshwer
Created January 23, 2018 11:26
Show Gist options
  • Save dvigneshwer/0eda74a93af65b3fc6cd2f655d705e68 to your computer and use it in GitHub Desktop.
Save dvigneshwer/0eda74a93af65b3fc6cd2f655d705e68 to your computer and use it in GitHub Desktop.
Installing regex in python3.6

Installtion instructions

regex_3/_regex.c:46:20: fatal error: Python.h: No such file or directory

If you are experiencing errors like the one above while trying to install regex via pip3.6, it basically means that the gcc needs the python.h header file for compilation and it's currently missing so you will have to install the python3.6-dev package to solve this problem.

Solution:

Follow the steps below to solve the above problem:

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo pip3.6 install regex

ref: https://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/

@robintel
Copy link

robintel commented Jan 2, 2019

For what OS is this?

I get:~$ add-apt-repository ppa:fkrull/deadsnakes
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment