Giter Site home page Giter Site logo

Install script unable to compile python(Python/fileutils.c:2398:9: error: implicit declaration of function ‘close_range’) about pyenv HOT 7 CLOSED

so1n avatar so1n commented on July 20, 2024
Install script unable to compile python(Python/fileutils.c:2398:9: error: implicit declaration of function ‘close_range’)

from pyenv.

Comments (7)

native-api avatar native-api commented on July 20, 2024 1

I'm very sorry that I didn't make it clear that there are two versions of the download url provided in the image url. the url I used for the image is https://cdimage.deepin.com/releases/23-RC2/amd64/

That surely helps! I was able to reproduce it.

close_range declaration is simply missing from unistd.h. I'm not completely sure how configure finds it. Looking at its test code, the test code makes an alternative declaration and then calls it (without arguments). It probably works because it's a system call -- i.e. it's implemented in the kernel, so it would be found with any declaration.

Summarizing, this is a problem with the distro, the unistd.h header doesn't match the kernel.

from pyenv.

native-api avatar native-api commented on July 20, 2024

WFM on a clean installation from https://cdimage.deepin.com/releases/23-Beta2/
The version on the link you gave is v20.9 . The kernel version on the above link is 6.1.32-amd64-desktop-hwe .
Please double-check which distro version you're running.

For now, I dug up the following:

I see that close_range is defined in /usr/include/unistd.h if __USE_GNU is defined, which is defined in /usr/include/features.h if _GNU_SOURCE is defined, which is defined in generated pyconfig.h in the build tree (the path to the build tree is reported near the "BUILD FAILED" message).

Please check that you don't have any bogus headers with those names on the compiler search path (e.g. in /usr/local), that the above is true for your versions, and if not, reinstall the packages that they belong to (find the package that a file belongs to with dpkg -S <full path>).

from pyenv.

native-api avatar native-api commented on July 20, 2024

I see that the beta does have an upgrade to kernel 6.6.25, but upgrading with apt dist-upgrade bricks my VM.

from pyenv.

so1n avatar so1n commented on July 20, 2024

I'm very sorry that I didn't make it clear that there are two versions of the download url provided in the image url. the url I used for the image is https://cdimage.deepin.com/releases/23-RC2/amd64/

I didn't have the computer with which I had the problem with me when I left the house today, I will try the following at a later:

Please check that you don't have any bogus headers with those names on the compiler search path (e.g. in /usr/local), that the above is true for your versions, and if not, reinstall the packages that they belong to (find the package that a file belongs to with dpkg -S <full path>).

from pyenv.

so1n avatar so1n commented on July 20, 2024

@native-api I think I found a good solution:

  • 1: Find tmp dir from commod output:
    ➜  pyenv install 3.10.4
    Downloading Python-3.10.4.tar.xz...
    -> https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tar.xz
    Installing Python-3.10.4...
    
    BUILD FAILED (Deepin 23 using python-build 2.4.3)
    
    Inspect or clean up the working tree at /tmp/python-build.20240622021759.359752
    Results logged to /tmp/python-build.20240622021759.359752.log
    
  • 2: Go to the folder /tmp/python-build.20240622021759.359752
  • 3: Find the error message via trace.log
    Python/fileutils.c:2398:9: error: implicit declaration of function ‘close_range’ [-Werror=implicit-function-declaration]
    
  • 4:In the current path(/tmp/python-build.20240622021759.359752), open Python/fileutils.c and Jump to 2397 (2398 -1), enter the following code:
    extern int close_range(int first, int last, unsigned int flags);
    
  • 5: Use make & make altinstall

Once the command has finished running, you can see the installed version through pyenv version:

➜  pyenv versions
* system (set by /home/so1n/.pyenv/version)
  3.8.16
  3.9.16
  3.10.4

from pyenv.

native-api avatar native-api commented on July 20, 2024
  • 5: Use make & make altinstall

Nice find!
This won't run postinstall steps though like creating aliases for pythonX.Y. You'd have to perform those by hand as well.

from pyenv.

so1n avatar so1n commented on July 20, 2024
  • 5: Use make & make altinstall

Nice find! This won't run postinstall steps though like creating aliases for pythonX.Y. You'd have to perform those by hand as well.

pyenv sheel and pyenv virtualenv Can't load properly into my installation of python 3.10.4.
But I can get up to version 3.10.4 properly in poetry, and that's enough for me.

from pyenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.