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

Build failed. Unable to generate C code using cython3 #98

Open
ali-oem opened this issue Sep 28, 2020 · 16 comments
Open

Build failed. Unable to generate C code using cython3 #98

ali-oem opened this issue Sep 28, 2020 · 16 comments

Comments

@ali-oem
Copy link

ali-oem commented Sep 28, 2020

After using build.sh command , i got the following output in terminal (I'm using Ubuntu 18.04) :
Torghost installer v3.0
Installing prerequisites
Reading package lists... Done
Building dependency tree
Reading state information... Done
tor is already the newest version (0.3.2.10-1).
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.2).
0 to upgrade, 0 to newly install, 0 to remove and 30 not to upgrade.
Installing dependencies
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
WARNING: The directory '/home/ali/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: stem>=1.7.1 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 1)) (1.7.1)
Requirement already satisfied: requests>=2.22.0 in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 2)) (2.24.0)
Requirement already satisfied: cython in /usr/local/lib/python3.6/dist-packages (from -r requirements.txt (line 3)) (0.29.21)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests>=2.22.0->-r requirements.txt (line 2)) (2018.1.18)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/lib/python3/dist-packages (from requests>=2.22.0->-r requirements.txt (line 2)) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3/dist-packages (from requests>=2.22.0->-r requirements.txt (line 2)) (1.22)
Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3/dist-packages (from requests>=2.22.0->-r requirements.txt (line 2)) (2.6)
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
mkdir: cannot create directory ‘build’: File exists
./build.sh: 8: ./build.sh: cython3: not found
[ERROR] Build failed. Unable to generate C code using cython3

@1UC1F3R616
Copy link

@ali-oem try installing using sudo ./build.sh

@ali-oem
Copy link
Author

ali-oem commented Sep 30, 2020

@ali-oem try installing using sudo ./build.sh

I did it with sudo

@1UC1F3R616
Copy link

@ali-oem try installing using sudo ./build.sh

I did it with sudo

ur OS?

@ali-oem
Copy link
Author

ali-oem commented Sep 30, 2020

@ali-oem try installing using sudo ./build.sh

I did it with sudo

ur OS?

Elementary OS Hera

@1UC1F3R616
Copy link

@ali-oem

  • delete this directory mkdir: cannot create directory ‘build’: File exists
  • and then reinstall

error is saying that cython3: not found, I think the above skip is skipping this installation as well, so you try a clean install once again.

@ali-oem
Copy link
Author

ali-oem commented Oct 2, 2020

@ali-oem

  • delete this directory mkdir: cannot create directory ‘build’: File exists
  • and then reinstall

error is saying that cython3: not found, I think the above skip is skipping this installation as well, so you try a clean install once again.

What should I delete?

@zareshahi
Copy link

zareshahi commented Oct 10, 2020

same issue
solved by
apt install cython3
:D

@ali-oem
Copy link
Author

ali-oem commented Oct 10, 2020

same issue
solved by
apt install cython3
:D

Worked yes !
But now having this :
mkdir: cannot create directory ‘build’: File exists Compiling /home/ali/torghost/torghost.py /usr/local/lib/python3.6/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/ali/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 #include "Python.h" ^~~~~~~~~~ compilation terminated. [ERROR] Build failed

@arthur-bryan
Copy link

same issue
solved by
apt install cython3
:D

Worked yes !
But now having this :
mkdir: cannot create directory ‘build’: File exists Compiling /home/ali/torghost/torghost.py /usr/local/lib/python3.6/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/ali/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 #include "Python.h" ^~~~~~~~~~ compilation terminated. [ERROR] Build failed

Same here.

@gh0o5t
Copy link

gh0o5t commented Nov 5, 2020

same issue
solved by
apt install cython3
:D

Worked yes !
But now having this :
mkdir: cannot create directory ‘build’: File exists Compiling /home/ali/torghost/torghost.py /usr/local/lib/python3.6/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/ali/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 #include "Python.h" ^~~~~~~~~~ compilation terminated. [ERROR] Build failed

Same here.

The problem is the lack of Python3.8 on your operating systems. When using gcc in the build.sh , the script explicitly includes header files from /usr/include/python3.8. Installing Python3.8 may solve the issue, however I have not yet tried it.

@tykavanaugh
Copy link

I had the same problem, was fixed after I first deleted my old VM and installed a whole new kali VM and sudo apt install cython3

Prior to deleting my old machine, sudo apt install cython3 did not fix it for some reason even though I was using python 3.8.

@nonetrix
Copy link

I am having this issue on arch however reinstalling doesn't do anything

@nonetrix
Copy link

nonetrix commented Dec 17, 2020

it is just called cython and not cython3 for me editing bulid.sh worked

@tykavanaugh
Copy link

It worked after I installed cython using apt instead of pip or conda on Ubuntu, Mint and Kali.

I have no tried again on base debian.

@nonetrix
Copy link

Honestly it should check for cython and cython3 in /bin and use which ever one is in there

@eksvu
Copy link

eksvu commented Jan 13, 2021

та же проблема
решена
apt install cython3
: D

Сработало да!
Но теперь имея это:
mkdir: cannot create directory ‘build’: File exists Compiling /home/ali/torghost/torghost.py /usr/local/lib/python3.6/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/ali/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 #include "Python.h" ^~~~~~~~~~ compilation terminated. [ERROR] Build failed

Тоже самое.

Проблема в том, что в ваших операционных системах отсутствует Python3.8. При использовании gcc в build.sh скрипт явно включает файлы заголовков из /usr/include/python3.8. Установка Python3.8 может решить проблему, но я еще не пробовал.

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

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

8 participants