Reputation: 849
I am using Ubuntu 14.04, and I have Python 3.4 and Python2.7 installed. I installed scrapy using
sudo pip install scrapy
and if I try to rerun this, the terminal outputs :
Requirement already satisfied (use --upgrade to upgrade): scrapy in /usr/local/lib/python2.7/dist-packages
But when I try to start a new project, I get this :
$ scrapy startproject tutorial
bash: /usr/local/bin/scrapy: No file or directory of this type
How should I change the path to Scrapy ?
Thanks a lot !
Upvotes: 2
Views: 2979
Reputation: 93
I know my answer is too late. I faced this issue today and resolved it so I am adding answer so that it might help someone in future.
It happened because I installed scrapy as local user and not root. When you install it as user with pip install scrapy --user
the scrapy script is not copied to /usr/bin
. So in order to get it working you need to install it in one of the two ways:
sudo pip install scrapy
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from scrapy.cmdline import execute
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(execute())
Upvotes: 1
Reputation: 2136
First find where scrapy is installed
whereis scrapy
Then add that path to environment variable PATH
lets say its /usr/bin
export PATH=$PATH:/usr/bin
Then you can call scrapy from anywhere.
Upvotes: 4