SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
28 stars 10 forks source link

Error installing through PyPI in python 3.10 #347

Closed dakixr closed 1 year ago

dakixr commented 2 years ago

A dependency with cdmcfparser seems to be the root of the problem

Collecting inspect4py
  Downloading inspect4py-0.0.1-py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.3/54.3 KB 367.0 kB/s eta 0:00:00
Collecting configparser
  Downloading configparser-5.2.0-py3-none-any.whl (19 kB)
Collecting setuptools==54.2.0
  Downloading setuptools-54.2.0-py3-none-any.whl (785 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 785.1/785.1 KB 2.3 MB/s eta 0:00:00
Collecting graphviz
  Downloading graphviz-0.19.1-py3-none-any.whl (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.3/46.3 KB 1.3 MB/s eta 0:00:00
Requirement already satisfied: click in ./env-scc/lib/python3.10/site-packages (from inspect4py) (7.0)
Collecting pigar
  Downloading pigar-0.10.0-py2.py3-none-any.whl (6.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 5.1 MB/s eta 0:00:00
Collecting json2html
  Downloading json2html-1.3.0.tar.gz (7.0 kB)
  Preparing metadata (setup.py) ... done
Collecting astor
  Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting docstring-parser==0.7
  Downloading docstring_parser-0.7.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cdmcfparser
  Downloading cdmcfparser-2.4.0.tar.gz (117 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.3/117.3 KB 2.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
  Downloading cdmcfparser-2.3.2.tar.gz (116 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.6/116.6 KB 3.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
  Downloading cdmcfparser-2.3.1.tar.gz (115 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115.7/115.7 KB 2.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
  Downloading cdmcfparser-2.3.0.tar.gz (115 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115.7/115.7 KB 93.0 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
  Downloading cdmcfparser-2.2.3.tar.gz (115 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 115.5/115.5 KB 1.9 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting nbformat>=4.4.0
  Downloading nbformat-5.2.0-py3-none-any.whl (74 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.6/74.6 KB 1.7 MB/s eta 0:00:00
Requirement already satisfied: requests>=2.20.0 in ./env-scc/lib/python3.10/site-packages (from pigar->inspect4py) (2.27.1)
Collecting colorama>=0.3.9
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting traitlets>=4.1
  Using cached traitlets-5.1.1-py3-none-any.whl (102 kB)
Collecting jupyter-core
  Downloading jupyter_core-4.9.2-py3-none-any.whl (86 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.9/86.9 KB 1.8 MB/s eta 0:00:00
Collecting jsonschema!=2.5.0,>=2.4
  Downloading jsonschema-4.4.0-py3-none-any.whl (72 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.7/72.7 KB 1.7 MB/s eta 0:00:00
Requirement already satisfied: charset-normalizer~=2.0.0 in ./env-scc/lib/python3.10/site-packages (from requests>=2.20.0->pigar->inspect4py) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in ./env-scc/lib/python3.10/site-packages (from requests>=2.20.0->pigar->inspect4py) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./env-scc/lib/python3.10/site-packages (from requests>=2.20.0->pigar->inspect4py) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in ./env-scc/lib/python3.10/site-packages (from requests>=2.20.0->pigar->inspect4py) (2021.10.8)
Collecting attrs>=17.4.0
  Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Using cached pyrsistent-0.18.1-cp310-cp310-macosx_10_9_universal2.whl (81 kB)
Building wheels for collected packages: docstring-parser, cdmcfparser, json2html
  Building wheel for docstring-parser (pyproject.toml) ... done
  Created wheel for docstring-parser: filename=docstring_parser-0.7-py3-none-any.whl size=19109 sha256=8a0f5b516fb9ed5156a3ad1375a9f19a4307be3cf25491bea5c8e2aac081b36a
  Stored in directory: /Users/dakixr/Library/Caches/pip/wheels/06/08/0b/69b09c4b02dfe4b82ed139ea8208d32cb28a0eab1bb91004a8
  Building wheel for cdmcfparser (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      pypandoc package is not installed: the markdown README.md convertion to rst failed: No module named 'pypandoc'
      running bdist_wheel
      running build
      running build_py
      file cdmcfparser.py (for module cdmcfparser) not found
      file cdmcfparser.py (for module cdmcfparser) not found
      running build_ext
      building 'cdmcfparser' extension
      In file included from src/cflowfragments.cpp:26:
      src/cflowfragments.hpp:26:10: fatal error: 'node.h' file not found
      #include <node.h>
               ^~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cdmcfparser
  Running setup.py clean for cdmcfparser
  Building wheel for json2html (setup.py) ... done
  Created wheel for json2html: filename=json2html-1.3.0-py3-none-any.whl size=7609 sha256=68b089b07f03f7a14e8e9b607f52d06c4449ad6759c0a2743ad4ddab3c91bfe1
  Stored in directory: /Users/dakixr/Library/Caches/pip/wheels/e0/d8/b3/6f83a04ab0ec00e691de794d108286bb0f8bcdf4ade19afb57
Successfully built docstring-parser json2html
Failed to build cdmcfparser
Installing collected packages: json2html, cdmcfparser, traitlets, setuptools, pyrsistent, graphviz, docstring-parser, configparser, colorama, attrs, astor, jupyter-core, jsonschema, nbformat, pigar, inspect4py
  Running setup.py install for cdmcfparser ... error
  error: subprocess-exited-with-error

  × Running setup.py install for cdmcfparser did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      pypandoc package is not installed: the markdown README.md convertion to rst failed: No module named 'pypandoc'
      running install
      /Users/dakixr/Desktop/github/scc/env-scc/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      file cdmcfparser.py (for module cdmcfparser) not found
      file cdmcfparser.py (for module cdmcfparser) not found
      running build_ext
      building 'cdmcfparser' extension
      In file included from src/cflowfragments.cpp:26:
      src/cflowfragments.hpp:26:10: fatal error: 'node.h' file not found
      #include <node.h>
               ^~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cdmcfparser

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
dgarijo commented 2 years ago

@dakixr, which OS are you using? I had no issues in Unix, and we tested in macOS too.

dgarijo commented 2 years ago

Also, which Python version are you running this in? We need to update a little our dependencies for Python >3.9. Edit: I see you are in Python 3.10. We need to test this out.

dakixr commented 2 years ago

My current env is:

dgarijo commented 2 years ago

We have problems with control flow in Python > 3.9, this is a known issue. I need to test the libraries that have just been released.

Workarounds:

dgarijo commented 1 year ago

Fixed now.