This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, eric.araujo, erlendaasland, ned.deily, shreyanavigyan
Priority: normal Keywords:

Created on 2021-04-30 18:53 by shreyanavigyan, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (12)
msg392500 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-04-30 18:53
I'm trying to build CPython on Ubuntu but I can't get the external dependencies. Running this command :-

$ sudo apt-get build-dep python3

gives the output :-

Reading package lists... Done
E: You must put some 'deb-src' URIs in your sources.list

What is the exact string to add to /etc/apt/sources.list?

System Info: Ubuntu 20.04.1 (Focal Fossa)
Architecture: x64
GCC version: 9.3.0

(I've posted the problem in this issue tracker because Google and Stack Overflow doesn't seem to have an answer. I'm sorry for posting this here but no one seem to have the answer to this apart from core or experienced developers.)
msg392573 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-05-01 08:36
I've tweaked some of my settings and was able to get the dependencies but they are out of date. I tried upgrading them but not working.

(I'm not new to Ubuntu but I'm also not excellent at Ubuntu. A little bit of explanation would be helpful.)
msg393215 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2021-05-07 20:14
apt build-dep (or aptitude build-dep) is a command used to get build-time dependencies for the system package, which are not always the same as the upstream in-development version of Python.

As the error message told you, you need deb-src lines in your sources.list to have this work.  An example is here, it may not be up-to-date (refers to ubuntu bionic and python3.6) but hopefully you can adapt it: https://devguide.python.org/setup/#build-dependencies

I think more explanations should come from ubuntu documentation or forums, not Python docs; Python can’t document every facility from every OS.
msg393216 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2021-05-07 20:16
Some results from a quick web search:
- https://wiki.debian.org/BuildingTutorial
- https://unix.stackexchange.com/questions/158395/apt-get-build-dep-is-unable-to-find-a-source-package
- https://www.linuxfordevices.com/tutorials/debian/build-packages-from-source
msg393246 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-05-08 08:58
I know the deb-src problem and I've added that a long time ago. The problem is that I don't know which repository has the unstable source. I'm on Ubuntu Focal Fossa. I successfully can fetch sources but they are not up-to-date. I can't figure out the repository and the component.
msg393249 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-05-08 12:02
It's also pretty problematic that Python depends on the system header code rather than fetched source code like we do in OS X or Windows. I would like to suggest that we fetch source code and then use that instead of system header files. This wouldn't be a problem to implement since OS X and Linux behave in the same way because both share the same UNIX kernel and it wouldn't break any code out there. In fact it would improve the code. This would reduce all the setup we have to do beforehand on Linux especially Debian distributions.
msg393264 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-05-08 15:59
This problem doesn't exist in RPM Linux. Therefore creating a new DebianBuild directory (like there is PCBuild, Mac) just for Debian Linux. (I haven't tested RPM Linux and can't access any right now therefore I don't know if the problem exists there or not. But I'm gonna guess not for now.)
msg393272 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-05-08 18:21
Here's a trick I often recommend:
Do as the CI; use the posix-deps-apt.sh script!

You'll find it in your CPython git repo:
$ cd cpython.git  # change working dir to the CPython git repo
$ cat .github/workflows/posix-deps-apt.sh 
#!/bin/sh
apt-get update

apt-get -yq install \
    build-essential \
    ccache \
    gdb \
    lcov \
    libbz2-dev \
    libffi-dev \
    libgdbm-dev \
    liblzma-dev \
    libncurses5-dev \
    libreadline6-dev \
    libsqlite3-dev \
    libssl-dev \
    lzma \
    lzma-dev \
    tk-dev \
    uuid-dev \
    xvfb \
    zlib1g-dev


Should work well on all Debian based Linux distros (that includes Ubuntu).
msg393273 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-05-08 18:22
I figured out the commands. The problem is they are not upgraded.
msg393274 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-05-08 18:29
This isn't a bug with Python, it is a development environment issue.  The discussion would be more appropriate in help forums, like on discuss.python.org or Stackoverflow. And, if there si some deficiency in the devguide, there is a tracker for issues with it: https://github.com/python/devguide/issues
msg393275 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-05-08 18:30
I have been following this issue for a while. I feel it's getting increasingly offtopic for Python bug tracker. Any concerns or problems with your distro are better suited for the help and discussion forums of your distribution.

Ah, Ned just closed the issue while I was typing.
msg393277 - (view) Author: Shreyan Avigyan (shreyanavigyan) * Date: 2021-05-08 18:33
I never said this was a bug. But what I'm saying is there should be a different build for Debian because Debian has a reputation of using outdated packages.
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88158
2021-05-08 18:33:08shreyanavigyansetmessages: + msg393277
2021-05-08 18:31:12christian.heimessetstatus: open -> closed
resolution: third party
stage: resolved
2021-05-08 18:30:55christian.heimessetstatus: closed -> open

nosy: + christian.heimes
messages: + msg393275

resolution: not a bug -> (no value)
stage: resolved -> (no value)
2021-05-08 18:29:55ned.deilysetstatus: open -> closed

nosy: + ned.deily
messages: + msg393274

resolution: not a bug
stage: resolved
2021-05-08 18:22:58shreyanavigyansetmessages: + msg393273
2021-05-08 18:21:01erlendaaslandsetnosy: + erlendaasland
messages: + msg393272
2021-05-08 15:59:03shreyanavigyansetmessages: + msg393264
2021-05-08 12:02:52shreyanavigyansetmessages: + msg393249
2021-05-08 08:58:07shreyanavigyansetmessages: + msg393246
2021-05-07 20:16:08eric.araujosetmessages: + msg393216
2021-05-07 20:14:30eric.araujosetnosy: + eric.araujo
messages: + msg393215
2021-05-01 08:36:08shreyanavigyansetmessages: + msg392573
2021-04-30 18:53:40shreyanavigyancreate