- Download and install miniconda3: https://docs.conda.io/en/latest/miniconda.html
- Open Anaconda Prompt (miniconda3)
conda create --prefix=conda-env python==3.8
conda config --set env_prompt '({name})
<-- Just onceconda activate conda-env
conda install <package-name>
conda install -c conda-forge <package-name>
- Inside conda-env, run:
pip install <package-name>
Conda envs aren’t globally isolated. The default behavior when creating a pip virtual environment is that when inside the new environment, you do not have access to globally installed pip packages. If you want access to global packages, you need to initialize your virtual environment with:
virtualenv env --system-site-packages
conda , on the other hand, lets you access global system packages by default. If you want the environment to be completely isolated from these global packages like with pip, you can create the conda environment based on a clone of an empty pip virtualenv.
pip install virtualenv
conda create --prefix=tmp-env python==3.8
conda activate /tmp-env
virtualenv empty-env
<-- run this command with the tmp-env activatedconda create --prefix=conda-env --clone empty-env
<-- this will create an insolated conda-env with python==3.8
Steps 4 and 5 in the insolated environment are necessary since virtualenv uses the default python interpreter in the current path.
Run
conda init
beforehandmake sure run
conda init powershell
in windows