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

Building wheel fails due post-install hook #30

Open
hiir opened this issue Oct 30, 2018 · 4 comments
Open

Building wheel fails due post-install hook #30

hiir opened this issue Oct 30, 2018 · 4 comments

Comments

@hiir
Copy link

hiir commented Oct 30, 2018

Hello,

When trying to build a wheel for rake-nltk package it fails if system does not have nltk package installed explicitly.

  1. create empty virtual environment & switch to it
  2. issue pip wheel command:
pip wheel rake-nltk
...
    File "/tmp/pip-wheel-u4cxytr5/rake-nltk/setup.py", line 17, in _post_install        
      import nltk                                                                       
  ModuleNotFoundError: No module named 'nltk'                                           
                                                                                        
  ----------------------------------------                                              
  Failed building wheel for rake-nltk                                                   
  Running setup.py clean for rake-nltk                                                  
Failed to build rake-nltk                                                               
ERROR: Failed to build one or more wheels                                               

Apparently during bdist or bdist_wheel commands distutils also does an "fake" install -- and apparently without installing requirements before.

From docs: https://docs.python.org/3/distutils/builtdist.html

then the Distutils builds my module distribution (the Distutils itself in this case), does a “fake” installation

I am not familiar with distutils enough to know if it is possible to distinguish such "fake" install from real install.

Our use case is to build wheels during packaging progress on build server and then later use these wheels to speed up deployment. There is no reason to install python packages on build server itself and in some cases it would be hard to identify requirements before -- for an example if some other package has rake-nltk as install_requirement in setup.py.

This problem would not exists if rake-nltk would be available as wheel on pypi (but then package installation would not automatically download "punkt" and "stopwords").

@kiranmahto
Copy link

Is this issue has any solution

@mnvoh
Copy link

mnvoh commented Apr 14, 2019

Running these before installing rake-nltk fixed the problem for me. All of them may or may not be required:

pip3 install -U nltk
pip3 install -U numpy
python3 -m nltk.downloader all
pip3 install rake-nltk

@jcbrockschmidt
Copy link

jcbrockschmidt commented Jan 20, 2021

Note that while rake-nltk will be successfully installed by falling back on setup.py install in pip version 20 and prior, this fallback will be deprecated in version 21. Here's the deprecation warning:

  DEPRECATION: rake-nltk was installed using the legacy 'setup.py install' method, because a wheel could not be built for it.
pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above.
You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.

@kuraga
Copy link

kuraga commented May 5, 2021

Facing the same issue.

Leave downloading datasets to user!

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

5 participants