pip install vs conda install

# Step 1: Create a Conda environmentconda 
create --name myenv python=3.8
# Step 2: Activate the environment
conda activate myenv
# Step 3: Install packages with Conda
conda install numpy scipy pandas
# Step 4: Install remaining packages with Pip (if not available in Conda)
pip install transformers requests
  1. After we activate the virtual environment, all the packages installed by Conda and pip will be in the virtual environment.
  2. Packages installed by conda install will be more compatible. So we should use Conda install first.
  3. Some packages are not provided by conda. Then, we need to use pip, which provides a broader selection for Python-only packages.
  4. We can check whether the packages installed by pip are in the specific environment or not by the following command.
which pip