Can I install conda packages with pip?

58 Views Asked by At

I want to install a package on macOS, which can be done by

conda env create -f environment.yaml
conda activate <package>

but I don't want to install conda and am looking for an alternative to install it with pip or source commands.

I tried source env create -f environment.yaml, and it errors out as /usr/bin/env:1: parse error near ')'.

If possible, I am looking for an alternative to install conda packages with pip.

1

There are 1 best solutions below

0
Chathura Abeywickrama On

you can install Python packages directly using pip. Create a virtual environment and install packages from a requirements file

python3 -m venv myenv
source myenv/bin/activate
pip install -r environment.yaml

You need to replace myenv with your desired virtual environment name and environment.yaml with the name of your requirements file.