03-20-2020 01:18 AM
Following the guideline on 'How To Setup Your Own Computer' @
https://developer.cisco.com/learning/modules/intro-to-aci/sbx-intro-aci-02_programmability-options/step/2,
came-up with an issue, as per Title, when installing ACI Toolkit after git clone https://github.com/datacenter/acitoolkit.git
cd acitoolkit
python setup.py install
----
Installed /home/qaswar/aci_ansible_learning_labs_code_samples/venv/lib/python3.6/site-packages/jsonschema-3.2.0-py3.6.egg
Searching for py-radix
Reading https://pypi.org/simple/py-radix/
Downloading https://files.pythonhosted.org/packages/bf/4e/47d9e7f4dfd0630662e19d2cc1b2f1d307ec52df11f4a66f6ed6f0cce138/py-radix-0.10.0.tar.gz#sha256=b8dbd1344bb30c6a1097d4103203c7b117d92931620365985018de4bef5aede3
Best match: py-radix 0.10.0
Processing py-radix-0.10.0.tar.gz
Writing /tmp/easy_install-vexj8iwv/py-radix-0.10.0/setup.cfg
Running py-radix-0.10.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vexj8iwv/py-radix-0.10.0/egg-dist-tmp-npf9agv8
radix/_radix.c:17:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
03-20-2020 01:31 AM
You need to install python-dev package first. For ubuntu/debian you can install it using apt:
sudo apt-get install python-dev
sudo apt-get install python3-dev
Regards,
Sergiu
03-20-2020 01:11 PM
Since the lab was verified with Python 3.7.5 on CentOS, MAC OS and Windows. So I followed the CentOS Sample Setup Instructions Example
03-20-2020 01:27 PM
BTW the problem comes during the setup.py install when decision is made for py-radix 0.10.0 (Downloaded from https://files.pythonhosted.org) but py-radix-0.10.0/setup.py comes up with fatal error:
Python.h: No such file or directory
03-21-2020 01:10 AM
For apt (Ubuntu, Debian...):
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
For yum (CentOS, RHEL...):
sudo yum install python-devel # for python2.x installs
sudo yum install python3-devel # for python3.x installs
For dnf (Fedora...):
sudo dnf install python2-devel # for python2.x installs
sudo dnf install python3-devel # for python3.x installs
For zypper (openSUSE...):
sudo zypper in python-devel # for python2.x installs
sudo zypper in python3-devel # for python3.x installs
For apk (Alpine...):
# This is a departure from the normal Alpine naming # scheme, which uses py2- and py3- prefixes
sudo apk add python2-dev # for python2.x installs
sudo apk add python3-dev # for python3.x installs
For apt-cyg (Cygwin...):
apt-cyg install python-devel # for python2.x installs
apt-cyg install python3-devel # for python3.x installs
03-21-2020 03:05 PM
Thanks it went through!
So it has nothing to do with earlier step in the procedure under 'Pull Down Sample Code and Prep Python Environment' where py-radix could not be installed as 'pip install -r requirements.txt' errored out with exit status 1, earlier in the list of requirement.txt, at flask-bootstrap?
If this is not relevant and earlier 3.7 version of python3 devel is not an issue for the lab, this is acceptable solution then
03-24-2020 06:19 AM
Did you use?
sudo yum install python3-devel
python3-devel contains Libraries and header files needed for Python development.
If .. py-radix could not be installed as 'pip install -r requirements.txt' errored out with exit status 1 .. did it fail to build? gcc error? aci toolkit install failed as it couldn't find the python.h file. These .h files are part of python3-devel
HTH
07-13-2022 12:20 AM
Most of the time these are dependency-issues. Python.h is used by GNU Compiler Collection (gcc) to build applications. You need to install a package called python-dev for building Python modules, extending the Python interpreter or embedding Python in applications. You encounter "Python.h: No such file or directory" error while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.
Reason for this error:
How to solve this error:
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide