SusmithKrishnan / torghost

TorGhost is an anonymization script. TorGhost redirects all internet traffic through SOCKS5 tor proxy. DNS requests are also redirected via tor, thus preventing DNSLeak. The scripts also disables unsafe packets exiting the system. Some packets like ping request can compromise your identity.
GNU General Public License v3.0
856 stars 281 forks source link

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

Open themystically opened 3 years ago

themystically commented 3 years ago

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 commented 3 years ago

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

eksvu commented 3 years ago

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 commented 3 years ago

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