If you’re working with Scrapy and have stumbled upon the not-so-friendly -bash: scrapy: command not found
message, worry not. There are several ways to ensure Scrapy runs seamlessly from your terminal without the need to type out its full path each time. Let’s streamline your setup with these condensed steps. 🚀
pip install scrapy
pip install httpx
Quick Setup for Scrapy Command Access
Choose one of the following methods to ensure Scrapy is available system-wide or for your user profile:
Method 1: Add Scrapy to PATH
echo "export PATH=\$PATH:/usr/local/python3/bin" >> ~/.bashrc && source ~/.bashrc
Method 2: Create a Symlink & Set up an Alias
ln -s /usr/local/python3/bin/scrapy /usr/local/bin/scrapy
echo "alias scrapy='/usr/local/python3/bin/scrapy'" >> ~/.bashrc && source ~/.bashrc
🔄 The Direct Approach
If you’re looking for a no-fuss method and don’t mind a bit of extra typing, you can continue to run Scrapy using the full path each time:
/usr/local/python3/bin/scrapy runspider ss.py --nolog
Choose the method that works best for you and streamline your Scrapy workflow today!