Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3.12.3 install in linuxmint failed: "error: ‘I_PUSH’ undeclared" #2964

Closed
5 of 13 tasks
BrentHuang opened this issue May 16, 2024 · 7 comments
Closed
5 of 13 tasks

Comments

@BrentHuang
Copy link

BrentHuang commented May 16, 2024

Too many issues will kill our team's development velocity, drastically.
Make sure you have checked all steps below.

Prerequisite

  • Make sure your problem is not listed in the common build problems.
  • Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
  • Make sure you are not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • Make sure your problem is not derived from packaging (e.g. Homebrew).
    • Please refer to the package documentation for the installation issues, etc.
  • Make sure your problem is not derived from plugins.
    • This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

Description

  • Platform information (e.g. Ubuntu Linux 16.04): Linux Mint 21.3 Virginia
  • OS architecture (e.g. amd64): x86_64
  • pyenv version: pyenv 2.4.1
  • Python version: 3.12.3
  • C Compiler information (e.g. gcc 7.3): gcc (Ubuntu 11.4.0-1ubuntu122.04) 11.4.0, g++ (Ubuntu 11.4.0-1ubuntu122.04) 11.4.0
  • Please attach the debug trace of the failing command as a gist:
    • Run env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.log and attach trace.log. E.g. if you have a problem with installing Python, run env PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log (note the -v option to pyenv install).
  • If you have a problem with installing Python, please also attach config.log from the build directory
    • The build directory is reported after the "BUILD FAILED" message and is usually under /tmp.
  • If the build succeeds but the problem is still with the build process (e.g. the resulting Python is missing a feature), please attach
    • the debug trace from reinstalling the faulty version with env PYENV_DEBUG=1 pyenv install -f -k -v <version> 2>&1 | tee trace.log
    • config.log from the build directory. When using pyenv install with -k as per above, the build directory will be under $PYENV_ROOT/sources.

python-build.20240516101847.83035.log

@native-api
Copy link
Member

native-api commented May 16, 2024

./Modules/fcntlmodule.c:632:33: error: ‘I_PUSH’ undeclared (first use in this function)
  632 |     if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
      |                                 ^~~~~~

Your stropts.h (where this macro is supposed to be defined) is broken or bogus.

Probably the latter since at my machine (Ubuntu 22.04), it's missing altogether and online search shows that it's not supposed to be present in Linux.

Check if you have such a file outside of the compiler's toolchain but on the compiler's search path (e.g. in /usr/local).

@native-api native-api changed the title python3.12.3 install in linuxmint failed python3.12.3 install in linuxmint failed: "error: ‘I_PUSH’ undeclared" May 16, 2024
@BrentHuang
Copy link
Author

./Modules/fcntlmodule.c:632:33: error: ‘I_PUSH’ undeclared (first use in this function)
  632 |     if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
      |                                 ^~~~~~

Your stropts.h (where this macro is supposed to be defined) is broken or bogus.

Probably the latter since at my machine (Ubuntu 22.04), it's missing altogether and online search shows that it's not supposed to be present in Linux.

Check if you have such a file outside of the compiler's toolchain but on the compiler's search path (e.g. in /usr/local).

I find it. but /usr/include/stropts.h is an empty file, with 0 size.

@native-api
Copy link
Member

I find it. but /usr/include/stropts.h is an empty file, with 0 size.

Delete it.

@native-api
Copy link
Member

native-api commented May 16, 2024

I find it. but /usr/include/stropts.h is an empty file, with 0 size.

Delete it.

Just in case, you can use dpkg -S <full path> to check if this file belongs to any package (see https://www.cyberciti.biz/faq/equivalent-of-rpm-qf-command/).

@BrentHuang
Copy link
Author

BrentHuang commented May 17, 2024

hgc@hgc-H410M-H-V3:~$ dpkg -S /usr/include/stropts.h 
dpkg-query: no path found matching pattern /usr/include/stropts.h
hgc@hgc-H410M-H-V3:~$ 

@native-api
Copy link
Member

hgc@hgc-H410M-H-V3:~$ dpkg -S /usr/include/stropts.h 
dpkg-query: no path found matching pattern /usr/include/stropts.h
hgc@hgc-H410M-H-V3:~$ 

As I thought, looks like an accidentally created bogus file, should be safe to delete.

@BrentHuang
Copy link
Author

hgc@hgc-H410M-H-V3:~$ dpkg -S /usr/include/stropts.h 
dpkg-query: no path found matching pattern /usr/include/stropts.h
hgc@hgc-H410M-H-V3:~$ 

As I thought, looks like an accidentally created bogus file, should be safe to delete.

yes, you are right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants