#๐Ÿ”’ can't build `readline` while creating venv

19 messages ยท Page 1 of 1 (latest)

brazen locustBOT
#

@distant adder

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

distant adder
#

os: ubuntu 24.10

#

python version: 3.12.7

quiet bridge
#

Sounds like you need to install gcc on your operating system.

#

From this:

      building 'readline' extension
      creating build/temp.linux-x86_64-cpython-312/Modules/3.x
      x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/home/duomg/Documents/GitHub/baba-lang/.venv/include -I/usr/include/python3.12 -c Modules/3.x/readline.c -o build/temp.linux-x86_64-cpython-312/Modules/3.x/readline.o -Wno-strict-prototypes
      error: command 'x86_64-linux-gnu-gcc' failed: No such file or directory
      [end of output]
distant adder
regal cedar
distant adder
#

lol installing readline is so painful

quiet bridge
#

Python normally ships with readline as standard. Maybe your OS doesn't have it installed (also unlikely, it's very useful, and very used).

An ubuntu system here shows:

$ dpkg -l|grep readline
ii  libreadline-dev:amd64                  8.1.2-1                                 amd64        GNU readline and history libraries, development files
ii  libreadline8:amd64                     8.1.2-1                                 amd64        GNU readline and history libraries, run-time libraries
ii  readline-common                        8.1.2-1                                 all          GNU readline and history libraries, common files
#

Try making sure you have readline-common and libreadline8 and libreadline-dev installed?

#

I'm still surprised anything's trying to build readline from source.

distant adder
#

readline-common and libreadline8 is installed but not libreadline-dev```
duomg@duomg-Surface-Laptop-4:~$ sudo apt install readline-common
readline-common is already the newest version (8.2-5).
readline-common set to manually installed.
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 53
duomg@duomg-Surface-Laptop-4:~$ sudo apt install libreadline8
Note, selecting 'libreadline8t64' instead of 'libreadline8'
libreadline8t64 is already the newest version (8.2-5).
libreadline8t64 set to manually installed.
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 53
duomg@duomg-Surface-Laptop-4:~$ sudo apt install libreadline-dev
Installing:
libreadline-dev

Installing dependencies:
libncurses-dev

Suggested packages:
ncurses-doc readline-doc

Summary:
Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 53
Download size: 553 kB
Space needed: 3,238 kB / 18.5 GB available

Continue? [Y/n]

#

it still doesn't work with libreadline-dev installed

regal cedar
#

i just tried it in an ubuntu:24.04 docker container and it needed

apt install python3 python-is-python3 python3-pip python3-venv gcc lld libreadline-dev

then i could do pip install readline from within a venv

brazen locustBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.