1
votes

I am using python 2.7 and trying to install scrapy using pip but get this: Exception: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 324, in run requirement_set.prepare_files(finder) File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file abstract_dist.prep_for_dist() File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist self.req_to_install.run_egg_info() File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 412, in run_egg_info self.setup_py, self.name, File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 387, in setup_py import setuptools # noqa File "/root/.local/lib/python2.7/site-packages/setuptools/init.py", line 12, in import setuptools.version File "/root/.local/lib/python2.7/site-packages/setuptools/version.py", line 1, in import pkg_resources File "/root/.local/lib/python2.7/site-packages/pkg_resources/init.py", line 72, in import packaging.requirements File "/root/.local/lib/python2.7/site-packages/packaging/requirements.py", line 59, in MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker") TypeError: call() takes exactly 2 arguments (1 given)

3

3 Answers

3
votes

Seems there's a problem with your pip installation. I have two options for you.

1) Edit file /usr/lib/python2.7/site-packages/packaging/requirements.py and replace line

MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")

with

MARKER_EXPR = originalTextFor(MARKER_EXPR)("marker")

OR

2) Try and upgrade your pip installation with

pip install -U pip setuptools

1
votes

Error Code 1 Installing Scrapy talks about the different ways to install scrapy. Your error looks like a dependency issue and Error Code 1 Installing Scrapy explains

pip install wheel       #  to install support for wheel files.
pip install Scrapy‑1.0.3‑py2‑none‑any.whl        # to install the wheel.

If you use ubuntu, you can also install this via apt:

sudo apt-get install python-dev
sudo apt-get install libxml2-dev libxslt1-dev

Please check out the thread mentioned above for more info. That thread is really helpful.

0
votes

I used to have the same problem with you. And just type the below command, problem solved:

pip install setuptools==33.1.1