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

Installation issues due to newer cython #71

Closed
cthoyt opened this issue Oct 28, 2022 · 2 comments · Fixed by #72
Closed

Installation issues due to newer cython #71

cthoyt opened this issue Oct 28, 2022 · 2 comments · Fixed by #72

Comments

@cthoyt
Copy link
Member

cthoyt commented Oct 28, 2022

After running pip install adeft on python 3.11, I'm running into the following error message:

pip install adeft
Collecting adeft
  Using cached adeft-0.11.1.tar.gz (124 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: nltk in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from adeft) (3.7)
Requirement already satisfied: scikit-learn>=0.20.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from adeft) (1.1.3)
Requirement already satisfied: boto3 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from adeft) (1.25.3)
Requirement already satisfied: flask in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from adeft) (2.2.2)
Requirement already satisfied: appdirs in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from adeft) (1.4.4)
Requirement already satisfied: numpy>=1.17.3 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from scikit-learn>=0.20.0->adeft) (1.23.4)
Requirement already satisfied: scipy>=1.3.2 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from scikit-learn>=0.20.0->adeft) (1.9.3)
Requirement already satisfied: joblib>=1.0.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from scikit-learn>=0.20.0->adeft) (1.2.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from scikit-learn>=0.20.0->adeft) (3.1.0)
Requirement already satisfied: botocore<1.29.0,>=1.28.3 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from boto3->adeft) (1.28.3)
Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from boto3->adeft) (1.0.1)
Requirement already satisfied: s3transfer<0.7.0,>=0.6.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from boto3->adeft) (0.6.0)
Requirement already satisfied: Werkzeug>=2.2.2 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from flask->adeft) (2.2.2)
Requirement already satisfied: Jinja2>=3.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from flask->adeft) (3.1.2)
Requirement already satisfied: itsdangerous>=2.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from flask->adeft) (2.1.2)
Requirement already satisfied: click>=8.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from flask->adeft) (8.1.3)
Requirement already satisfied: regex>=2021.8.3 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from nltk->adeft) (2022.9.13)
Requirement already satisfied: tqdm in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from nltk->adeft) (4.64.1)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from botocore<1.29.0,>=1.28.3->boto3->adeft) (2.8.2)
Requirement already satisfied: urllib3<1.27,>=1.25.4 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from botocore<1.29.0,>=1.28.3->boto3->adeft) (1.26.12)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from Jinja2>=3.0->flask->adeft) (2.1.1)
Requirement already satisfied: six>=1.5 in /Users/cthoyt/.virtualenvs/indra/lib/python3.11/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.29.0,>=1.28.3->boto3->adeft) (1.16.0)
Building wheels for collected packages: adeft
  Building wheel for adeft (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-12-x86_64-3.11
      creating build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/util.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/discover.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/disambiguate.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/recognize.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/locations.py -> build/lib.macosx-12-x86_64-3.11/adeft
      creating build/lib.macosx-12-x86_64-3.11/adeft/modeling
      copying adeft/modeling/classify.py -> build/lib.macosx-12-x86_64-3.11/adeft/modeling
      copying adeft/modeling/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/modeling
      copying adeft/modeling/label.py -> build/lib.macosx-12-x86_64-3.11/adeft/modeling
      creating build/lib.macosx-12-x86_64-3.11/adeft/score
      copying adeft/score/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/score
      copying adeft/score/score.py -> build/lib.macosx-12-x86_64-3.11/adeft/score
      creating build/lib.macosx-12-x86_64-3.11/adeft/download
      copying adeft/download/download.py -> build/lib.macosx-12-x86_64-3.11/adeft/download
      copying adeft/download/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/download
      copying adeft/download/__main__.py -> build/lib.macosx-12-x86_64-3.11/adeft/download
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui
      copying adeft/gui/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/gui
      creating build/lib.macosx-12-x86_64-3.11/adeft/nlp
      copying adeft/nlp/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/nlp
      copying adeft/nlp/nlp.py -> build/lib.macosx-12-x86_64-3.11/adeft/nlp
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui/ground
      copying adeft/gui/ground/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground
      copying adeft/gui/ground/ground.py -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground
      running egg_info
      writing manifest file 'adeft.egg-info/SOURCES.txt'
      copying adeft/score/_score.c -> build/lib.macosx-12-x86_64-3.11/adeft/score
      copying adeft/nlp/stopwords.json -> build/lib.macosx-12-x86_64-3.11/adeft/nlp
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/static
      copying adeft/gui/ground/static/ground.css -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/static
      copying adeft/gui/ground/static/scripts.js -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/static
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/templates
      copying adeft/gui/ground/templates/input.jinja2 -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/templates
      running build_ext
      creating build/temp.macosx-12-x86_64-3.11
      creating build/temp.macosx-12-x86_64-3.11/adeft
      creating build/temp.macosx-12-x86_64-3.11/adeft/score
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/cthoyt/.virtualenvs/indra/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c adeft/score/_score.c -o build/temp.macosx-12-x86_64-3.11/adeft/score/_score.o
      adeft/score/_score.c:209:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.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 adeft
  Running setup.py clean for adeft
Failed to build adeft
Installing collected packages: adeft
  Running setup.py install for adeft ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for adeft did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running install
      /Users/cthoyt/.virtualenvs/indra/lib/python3.11/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
      creating build
      creating build/lib.macosx-12-x86_64-3.11
      creating build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/util.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/discover.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/disambiguate.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/recognize.py -> build/lib.macosx-12-x86_64-3.11/adeft
      copying adeft/locations.py -> build/lib.macosx-12-x86_64-3.11/adeft
      creating build/lib.macosx-12-x86_64-3.11/adeft/modeling
      copying adeft/modeling/classify.py -> build/lib.macosx-12-x86_64-3.11/adeft/modeling
      copying adeft/modeling/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/modeling
      copying adeft/modeling/label.py -> build/lib.macosx-12-x86_64-3.11/adeft/modeling
      creating build/lib.macosx-12-x86_64-3.11/adeft/score
      copying adeft/score/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/score
      copying adeft/score/score.py -> build/lib.macosx-12-x86_64-3.11/adeft/score
      creating build/lib.macosx-12-x86_64-3.11/adeft/download
      copying adeft/download/download.py -> build/lib.macosx-12-x86_64-3.11/adeft/download
      copying adeft/download/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/download
      copying adeft/download/__main__.py -> build/lib.macosx-12-x86_64-3.11/adeft/download
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui
      copying adeft/gui/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/gui
      creating build/lib.macosx-12-x86_64-3.11/adeft/nlp
      copying adeft/nlp/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/nlp
      copying adeft/nlp/nlp.py -> build/lib.macosx-12-x86_64-3.11/adeft/nlp
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui/ground
      copying adeft/gui/ground/__init__.py -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground
      copying adeft/gui/ground/ground.py -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground
      running egg_info
      writing manifest file 'adeft.egg-info/SOURCES.txt'
      copying adeft/score/_score.c -> build/lib.macosx-12-x86_64-3.11/adeft/score
      copying adeft/nlp/stopwords.json -> build/lib.macosx-12-x86_64-3.11/adeft/nlp
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/static
      copying adeft/gui/ground/static/ground.css -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/static
      copying adeft/gui/ground/static/scripts.js -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/static
      creating build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/templates
      copying adeft/gui/ground/templates/input.jinja2 -> build/lib.macosx-12-x86_64-3.11/adeft/gui/ground/templates
      running build_ext
      creating build/temp.macosx-12-x86_64-3.11
      creating build/temp.macosx-12-x86_64-3.11/adeft
      creating build/temp.macosx-12-x86_64-3.11/adeft/score
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/cthoyt/.virtualenvs/indra/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c adeft/score/_score.c -o build/temp.macosx-12-x86_64-3.11/adeft/score/_score.o
      adeft/score/_score.c:209:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.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.
╰─> adeft

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

This is a problem because they removed longintrepr.h in python/cpython#28968. It appears that the _score.c file https://github.com/indralab/adeft/blob/e0d882ada0ce81444d5b0a33cfbff33974f5d5c0/adeft/score/_score.c#L1

was generated using an old version of cython (we're on 0.29.32 now) so I think the fix is to regenerate it.

@steppi
Copy link
Collaborator

steppi commented Oct 28, 2022

Thanks @cthoyt! Hopefully I’ll have time to recompile tonight.

@cthoyt
Copy link
Member Author

cthoyt commented Oct 28, 2022

Thanks Albert! If it's possible to leave a few notes on how this is done it would be really insightful for the future :)

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

Successfully merging a pull request may close this issue.

2 participants