Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

fatal error: Python.h: No such file or directory #116

Open
themystically opened this issue Dec 29, 2020 · 3 comments
Open

fatal error: Python.h: No such file or directory #116

themystically opened this issue Dec 29, 2020 · 3 comments

Comments

@themystically
Copy link

sudo ./build.sh 148 ⨯ 3 ⚙
Torghost installer v3.0
Installing prerequisites
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (20.1.1-2).
tor is already the newest version (0.4.4.6-1).
0 upgraded, 0 newly installed, 0 to remove and 311 not upgraded.
Installing dependencies
Requirement already satisfied: stem>=1.7.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (1.8.0)
Requirement already satisfied: requests>=2.22.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (2.24.0)
Requirement already satisfied: cython in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (0.29.21)
mkdir: cannot create directory ‘build’: File exists
Compiling /home/jonny/torghost/torghost.py
/usr/lib/python3/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/jonny/torghost/torghost.py
tree = Parsing.p_module(s, pxd, full_module_name)
[SUCCESS] Generated C code
torghost.c:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
[ERROR] Build failed

@themystically
Copy link
Author

Solution - sudo apt-get install python3.8-dev

@eksvu
Copy link

eksvu commented Jan 13, 2021

sudo ./build.sh 148 3 ⚙
Установщик Torghost v3.0
Установка необходимых компонентов
Чтение списков пакетов ... Готово
Построение дерева зависимостей
Чтение информации о состоянии ... Готово
python3-pip уже является последней версией (20.1.1-2).
tor - это уже самая новая версия (0.4.4.6-1).
0 обновлено, 0 установлено заново, 0 удалено и 311 не обновлено.
Установка зависимостей
Требование уже выполнено: STEM> = 1.7.1 в / usr / lib / python3 / dist-packages (из -r requirements.txt (строка 1)) (1.8.0)
Требование уже выполнено: запросы> = 2.22.0 в / usr / lib / python3 / dist-packages (из -r requirements.txt (строка 2)) (2.24.0)
Требование уже выполнено: cython в / usr / lib / python3 / dist-packages (из -r requirements. txt (строка 3)) (0.29.21)
mkdir: невозможно создать каталог build: файл существует
Компиляция /home/jonny/torghost/torghost.py
/usr/lib/python3/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: директива Cython «language_level» не установлено, пока используется 2 (Py2). Это изменится в более позднем выпуске! Файл: /home/jonny/torghost/torghost.py
tree = Parsing.p_module (s, pxd, full_module_name)
[УСПЕХ] Сгенерированный код C
torghost.c: 4: 10: фатальная ошибка: Python.h: нет такого файла или каталога
4 | #include "Python.h"
| ^ ~~~~~~~~~
компиляция прекращена.
[ERROR] Не удалось построить

The problem is solved by changing the build.sh file
You need to see what version of python is installed.
Most likely version 3.9 is installed.
If so, then you need to adjust the following line build.sh

gcc -Os -I /usr/include/python3.9 -o torghost torghost.c -lpython3.9 -lpthread -lm -lutil -ldl

@pozgo
Copy link

pozgo commented Feb 18, 2021

Yup there should be a validator in build.sh that checks which version of python is installed and run it against it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants