How to configure Anaconda

If you want to explore data science and machine learning on Windows, Anaconda is the easiest way to get a running Python distribution with all required packages. You can install additional packages with the conda install command. The problem here is that most packages are available from the conda-forge channel, which is not enabled by default. If you want to use conda-forge by default (and you probably do), edit your .condarc (which is located in your user home directory) to look like this:

channel-priority: strict
channels:
- conda-forge
- defaults
ssl_verify: true
safety_checks: disabled

If you want to use PyTorch for machine learning and use Nvidia’s Cuda for GPU acceleration, you can install PyTorch like this:

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

Python’s default packet manager is pip, and many online sources will tell you to install packages via pip. This will however break Anaconda’s packet management, so this should only be done with packages that cannot be installed with conda. When in doubt, always try conda install first before doing pip install.

Leave a comment

Your email address will not be published. Required fields are marked *