Python Forum
pip3 install functools failed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip3 install functools failed
#1
I am trying to install functools to experiment with code that uses it, but it fails to install.

Distro is Fedora 29 Workstation.

$ pip3 install functools
Collecting functools
  Using cached https://files.pythonhosted.org/packages/22/3c/33589bf30422a92cf8c77054f2cf940ef2acc8a2857e5664045ed75a1c6a/functools-0.5.tar.gz
Installing collected packages: functools
  Running setup.py install for functools ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-2sncjil5/functools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6a32khwe/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    copying functools.py -> build/lib.linux-x86_64-3.7
    running build_ext
    building '_functools' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.7m -c src/functools.c -o build/temp.linux-x86_64-3.7/src/functools.o
    src/functools.c: In function ‘init_functools’:
    src/functools.c:43:6: warning: implicit declaration of function ‘Py_InitModule3’; did you mean ‘Py_Initialize’? [-Wimplicit-function-declaration]
      m = Py_InitModule3("_functools", NULL, functools_doc);
          ^~~~~~~~~~~~~~
          Py_Initialize
    src/functools.c:43:4: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
      m = Py_InitModule3("_functools", NULL, functools_doc);
        ^
    src/functools.c:45:3: warning: ‘return’ with no value, in function returning non-void
       return;
       ^~~~~~
    src/functools.c:38:1: note: declared here
     init_functools(void)
     ^~~~~~~~~~~~~~
    src/functools.c:49:2: warning: ‘return’ with no value, in function returning non-void
      return;
      ^~~~~~
    src/functools.c:38:1: note: declared here
     init_functools(void)
     ^~~~~~~~~~~~~~
    At top level:
    src/functools.c:28:19: warning: ‘rcsid’ defined but not used [-Wunused-const-variable=]
     static const char rcsid[] = "@(#)$Dima: pylib/functools/src/functools.c,v 1.3 2005/08/22 07:39:33 dima Exp $";
                       ^~~~~
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.7m -c src/compose.c -o build/temp.linux-x86_64-3.7/src/compose.o
    src/compose.c: In function ‘compose_dealloc’:
    src/compose.c:96:6: error: ‘struct compose’ has no member named ‘ob_type’; did you mean ‘ob_base’?
      co->ob_type->tp_free(co);
          ^~~~~~~
          ob_base
    src/compose.c: In function ‘compose_repr’:
    src/compose.c:137:6: warning: implicit declaration of function ‘PyString_FromFormat’; did you mean ‘PyBytes_FromFormat’? [-Wimplicit-function-declaration]
      s = PyString_FromFormat("<composition on %s at %p>",
          ^~~~~~~~~~~~~~~~~~~
          PyBytes_FromFormat
    src/compose.c:138:6: warning: implicit declaration of function ‘PyString_AsString’; did you mean ‘PyBytes_AsString’? [-Wimplicit-function-declaration]
          PyString_AsString(grepr), (void *)co);
          ^~~~~~~~~~~~~~~~~
          PyBytes_AsString
    src/compose.c:137:4: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
      s = PyString_FromFormat("<composition on %s at %p>",
        ^
    src/compose.c: At top level:
    src/compose.c:143:36: warning: missing braces around initializer [-Wmissing-braces]
     static PyTypeObject compose_type = {
                                        ^
    src/compose.c:146:2: warning: initialization of ‘long int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
      "compose",   /* tp_name */
      ^~~~~~~~~
    src/compose.c:146:2: note: (near initialization for ‘compose_type.tp_basicsize’)
    src/compose.c:150:2: warning: initialization of ‘int (*)(PyObject *, FILE *, int)’ {aka ‘int (*)(struct _object *, struct _IO_FILE *, int)’} from incompatible pointer type ‘void (*)(PyObject *)’ {aka ‘void (*)(struct _object *)’} [-Wincompatible-pointer-types]
      (destructor)compose_dealloc, /* tp_dealloc */
      ^
    src/compose.c:150:2: note: (near initialization for ‘compose_type.tp_print’)
    src/compose.c:155:2: warning: initialization of ‘PyNumberMethods *’ {aka ‘struct <anonymous> *’} from incompatible pointer type ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} [-Wincompatible-pointer-types]
      (reprfunc)compose_repr,  /* tp_repr */
      ^
    src/compose.c:155:2: note: (near initialization for ‘compose_type.tp_as_number’)
    src/compose.c:160:2: warning: initialization of ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
      (ternaryfunc)compose_call, /* tp_call */
      ^
    src/compose.c:160:2: note: (near initialization for ‘compose_type.tp_str’)
    In file included from /usr/include/python3.7m/pytime.h:6,
                     from /usr/include/python3.7m/Python.h:77,
                     from src/compose.c:31:
    /usr/include/python3.7m/object.h:671:29: warning: initialization of ‘const char *’ from ‘long unsigned int’ makes pointer from integer without a cast [-Wint-conversion]
     #define Py_TPFLAGS_DEFAULT  ( \
                                 ^
    src/compose.c:165:2: note: in expansion of macro ‘Py_TPFLAGS_DEFAULT’
      Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
      ^~~~~~~~~~~~~~~~~~
    /usr/include/python3.7m/object.h:671:29: note: (near initialization for ‘compose_type.tp_doc’)
     #define Py_TPFLAGS_DEFAULT  ( \
                                 ^
    src/compose.c:165:2: note: in expansion of macro ‘Py_TPFLAGS_DEFAULT’
      Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
      ^~~~~~~~~~~~~~~~~~
    src/compose.c:167:2: warning: initialization of ‘int (*)(PyObject *, int (*)(PyObject *, void *), void *)’ {aka ‘int (*)(struct _object *, int (*)(struct _object *, void *), void *)’} from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
      compose_doc,   /* tp_doc */
      ^~~~~~~~~~~
    src/compose.c:167:2: note: (near initialization for ‘compose_type.tp_traverse’)
    src/compose.c:168:2: warning: initialization of ‘int (*)(PyObject *)’ {aka ‘int (*)(struct _object *)’} from incompatible pointer type ‘int (*)(PyObject *, int (*)(PyObject *, void *), void *)’ {aka ‘int (*)(struct _object *, int (*)(struct _object *, void *), void *)’} [-Wincompatible-pointer-types]
      (traverseproc)compose_traverse, /* tp_traverse */
      ^
    src/compose.c:168:2: note: (near initialization for ‘compose_type.tp_clear’)
    src/compose.c:179:2: warning: initialization of ‘int (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘int (*)(struct _object *, struct _object *, struct _object *)’} from incompatible pointer type ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
      PyMethod_New,   /* tp_descr_get */
      ^~~~~~~~~~~~
    src/compose.c:179:2: note: (near initialization for ‘compose_type.tp_descr_set’)
    src/compose.c:184:2: warning: initialization of ‘void (*)(void *)’ from incompatible pointer type ‘PyObject * (*)(PyTypeObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _typeobject *, struct _object *, struct _object *)’} [-Wincompatible-pointer-types]
      compose_new,   /* tp_new */
      ^~~~~~~~~~~
    src/compose.c:184:2: note: (near initialization for ‘compose_type.tp_free’)
    src/compose.c:185:2: warning: initialization of ‘int (*)(PyObject *)’ {aka ‘int (*)(struct _object *)’} from incompatible pointer type ‘void (*)(void *)’ [-Wincompatible-pointer-types]
      PyObject_GC_Del,  /* tp_free */
      ^~~~~~~~~~~~~~~
    src/compose.c:185:2: note: (near initialization for ‘compose_type.tp_is_gc’)
    src/compose.c:143:36: warning: missing braces around initializer [-Wmissing-braces]
     static PyTypeObject compose_type = {
                                        ^
    src/compose.c:28:19: warning: ‘rcsid’ defined but not used [-Wunused-const-variable=]
     static const char rcsid[] = "@(#)$Dima: pylib/functools/src/compose.c,v 1.3 2005/08/22 07:39:33 dima Exp $";
                       ^~~~~
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-2sncjil5/functools/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6a32khwe/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-2sncjil5/functools/

Looks like functools is already there, just tried 'import functools' from the shell and it looks like it worked. I'll leave this here in case anyone is as stupid as me.
Reply
#2
(Mar-06-2019, 05:47 AM)kintarowonders Wrote: Looks like functools is already there, just tried 'import functools' from the shell and it looks like it worked

Yep, functools is a builtin module as of 2.5. Glad you found it :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem In using functools in a code akbarza 7 966 Oct-11-2023, 10:30 AM
Last Post: DeaD_EyE
  ModuleNotFoundError: No module named '_struct' when starting pip3 yuhuihu 0 2,809 May-05-2022, 04:41 AM
Last Post: yuhuihu
  cmake and pip3 install warnings with python 3.10.2 cyrduf 0 1,841 Feb-26-2022, 01:08 PM
Last Post: cyrduf
  what to do if moudle not in pip3 only in pip2? korenron 22 5,619 Oct-25-2021, 02:35 PM
Last Post: snippsat
  pip3 v21.1.2 SSL Error on RHEL 7 malibu 0 3,067 Jun-01-2021, 03:17 PM
Last Post: malibu
  pip3 install opencv-python fails on 'skbuild' Pedroski55 2 5,623 Sep-15-2020, 11:33 AM
Last Post: snippsat
  pip install -e ., ERROR: Failed building wheel for pyfarmhash mostafaPython 1 6,233 Jun-09-2020, 08:24 PM
Last Post: mcmxl22
  Install module with pip3 on a non root user matthewpintor2107 1 2,348 Apr-28-2020, 03:16 PM
Last Post: pyzyx3qwerty
  Wrong pip3 python location or new Version 007fred50 1 3,744 Apr-02-2020, 02:36 PM
Last Post: philgoetz
  Failed Install NetfilterQueue Alamily 3 10,071 Dec-08-2019, 06:52 AM
Last Post: Rocknpaper

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020