I am following the steps given in this link to Install NLTK http://www.bogotobogo.com/python/NLTK/NLTK_install.php.But I am getting error while running following command sudo pip install -U numpy .

output(last part):

    out = check_types(*a, **kw)

  File "numpy/core/setup.py", line 293, in check_types

    "Cannot compile 'Python.h'. Perhaps you need to "\

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-lYs_os/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Vu1Dyw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-lYs_os/numpy

please help to do this? Is there ny alternate way?!


Try installing python-dev as the error suggests:

sudo apt-get install python-dev

python-devel is for RHEL-based systems, and python-dev for Debian-based ones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.