Installation Tutorial for Python and Scrapy#
I am currently working on MacOS.
Python Installation Steps#
Python installation can be done using the official version or others; I chose to use Anaconda.
Anaconda is a Python scientific computing platform, which comes with many commonly used libraries, tools, and management features, making it easier for you to write code, handle data, and work on projects with Python.
It includes:
- ✅ Python interpreter (can replace your system's Python)
- ✅ Two package managers: pip and conda
- ✅ Scientific computing libraries (numpy, pandas, matplotlib, jupyterlab…)
- ✅ Virtual environment management tools (you can create and switch between different project environments at any time)
1. Download Python (This step only includes downloading from the official site)#
- Visit the official Python website https://www.python.org/downloads/
- Choose the latest version of Python to download (it is recommended to choose Python 3.x)
- Select the corresponding installation package based on your operating system:
- Windows: Download the .exe installation file
- Mac: Download the .pkg installation file
- Linux: Install using the package manager
2. Install Python#
MacOS installation steps:
- Run the downloaded .pkg file
- Wait for the installation to complete
3. Verify Installation#
Open the command line (terminal) and enter:
python --version
pip --version
Scrapy Installation Steps#
Since I need Scrapy, and both Scrapy and Python can be installed directly using Anaconda, which can automatically help you configure various packages, I chose to install everything using Anaconda in one go.
1. Download Anaconda#
Visit the Anaconda official website: https://www.anaconda.com/download
- Choose the installation package suitable for your operating system
- MacOS users should select the macOS installer (.pkg)
Installation steps:
- Run the downloaded installation package
- Follow the installation wizard to complete the installation
- Verify the installation by opening the terminal and entering:
conda --version
2. Install Python#
Enter the following command in the command line:
conda install python
3. Verify Python Installation#
Enter the following command in the command line:
python3 --version
4. Create a Virtual Environment#
Enter the following command in the command line to create a new virtual environment:
conda create -n scrapy_env python=3.x
Activate the virtual environment:
conda activate scrapy_env
5. Install Scrapy#
Install Scrapy in the activated virtual environment:
conda install scrapy
Or use pip to install: (this is recommended as using conda may lead to issues)
pip install scrapy
6. Verify Scrapy Installation#
Enter the following command in the command line:
scrapy version