ArchiveTeam / grab-site

The archivist's web crawler: WARC output, dashboard for all crawls, dynamic ignore patterns
Other
1.4k stars 135 forks source link

Pip build missing required package? #164

Closed cfcs closed 2 years ago

cfcs commented 4 years ago

on debian I seem to need pip3 install wheel before a number of the requirements work.

ivan commented 4 years ago

How can I reproduce this? Which Debian version? Were you running exactly https://github.com/ArchiveTeam/grab-site#install-on-ubuntu-1604-1804-debian-9-stretch-debian-10-buster or something else? Thanks.

cfcs commented 4 years ago

Hi @ivan - no, I was freestyling a little bit (if that's out of scope for your instructions, feel free to close this issue thread):

(EDIT: the situation was the same with these steps on both testing and unstable)

I ran the first step:

sudo apt-get update
sudo apt-get install --no-install-recommends \
    git build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
    libsqlite3-dev libffi-dev libxml2-dev libxslt1-dev libre2-dev pkg-config

then

# install the pip package instead of wget && ./installer sh
sudo apt install --no-install-recommends python3-pip

pip3 install --no-binary lxml --upgrade git+https://github.com/ArchiveTeam/grab-site

# that fails with a compile error complaining about <Python.h>, so install it:
sudo apt install --no-install-recommends python3-dev

# try again:
pip3 install --no-binary lxml --upgrade git+https://github.com/ArchiveTeam/grab-site

then you get a lot of these:

Skipping bdist_wheel for lxml, due to binaries being disabled for it.
Building wheels for collected packages: grab-site, fb-re2, lmdb, wpull, html5-parser, namedlist, sqlalchemy, tornado, yapsy
  Running setup.py bdist_wheel for grab-site ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-316wfik3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ltqxfweq --python-tag cp37:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

(snip)

....
  ----------------------------------------
  Failed building wheel for yapsy
  Running setup.py clean for yapsy
Failed to build grab-site fb-re2 lmdb wpull html5-parser namedlist sqlalchemy tornado yapsy
Installing collected packages: fb-re2, lmdb, manhole, websockets, dnspython, lxml, html5-parser, namedlist, sqlalchemy, tornado, yapsy, wpull, grab-site
(...)
  Running setup.py install for fb-re2 ... done
  Running setup.py install for lmdb ... done
(...)
Successfully installed dnspython-1.16.0 fb-re2-1.0.7 grab-site-2.1.18 html5-parser-0.4.9 lmdb-0.98 lxml-4.4.2 manhole-1.6.0 namedlist-1.7 sqlalchemy-1.3.12 tornado-4.5.3 websockets-8.1 wpull-3.0.7 yapsy-1.12.2

Since this left us with a number of the declared dependencies uninstalled:

pip3 install wheel
pip3 install --no-binary lxml --upgrade git+https://github.com/ArchiveTeam/grab-site

And now everything works :)

PythonCoderAS commented 2 years ago

I think Python assumes you have the wheel package installed, since I'm 95% sure it's installed as part of pip.

TheTechRobo commented 2 years ago

@PythonCoderAS it's not. for me I have the same issue sometimes. on debian you have to install python3-wheel or run python3 -m pip install wheel

PythonCoderAS commented 2 years ago

@TheTechRobo that is probably because you install a distro packaged version of python. If you install from source then pip, setuptools and wheel are also installed.

TheTechRobo commented 2 years ago

Yeah, I thought you meant in distro packages, as that is the point of the thread thta I can see.

PythonCoderAS commented 2 years ago

Yeah, I thought you meant in distro packages, as that is the point of the thread thta I can see.

I mean this seems more of a bug with pip rather than a bug with any package replying on pip.

ivan commented 2 years ago

I am closing this because I can't really support anything but the installation steps in the README, which are precise to avoid issues, and cover a lot of scenarios already. People doing undocumented things may have to understand Python packaging, which is not really something I understand any more.