Proxy configurations Anaconda

Proxy configurations Anaconda

First version: 2022-10-31
Latest version: 2023-11-16
Last change(s): Clarification in the introduction; clarifying instructions; added screenshots.

This is a community effort. The article was created by the anDREa Support Team in their spare time. If you have found a more efficient way to approach this, please contact us and will will update the article.

Introduction

To guarantee security, Workspaces do not have internet access by default. However, some software might need a certain degree of internet access to work. Instead of opening up to the whole internet, domain allowlisting can be requested. However, sometimes this might not be enough to reach the website(s). Certain software might need manual proxy configurations to be set in the software settings, before the software is able to reach domains through a proxy. In this article we describe how to manually configure Anaconda/Miniconda proxy settings.

Install Anaconda/Miniconda

  1. Whitelist the required domains.
    1. You will need at least:
      1. conda.io
      2. anaconda.com
      3. anaconda.org
  2. In the VM, open the browser and navigate to:
    1. conda.io for Miniconda
    2. anaconda.com for Anaconda
  3. Install a version.
In the example, Anaconda3 py310_2023.03-0 (64-bit) installer was used. The steps have been successfully replicated with the Anaconda3 2023.09-0 (64-bit) installer.

Setting the proxy in Anaconda Prompt

  1. Make sure the proxy is being used. Within the VM go to the magnifying glass on the bottom left and type 'Change proxy settings'.


  1. Make sure the Use proxy server setting is set to On and that the proxy address is correct.


The following steps of manually entering the proxy-settings through the Anaconda Prompt is no longer necessary for Anaconda3 version 2024.02 or newer. The same applies for Miniconda version 24.7.1 or newer. Older versions might still require the steps explained below. 

  1. Right click on Anaconda Prompt and select Run as Administrator. You know you're running Anaconda Prompt as administrator when it displays (base) C:\Windows\system32>

  1. Type the commands below. If you don't want to type it over, you can download the attached text file (at the bottom of the article) and upload it to your Workspace. You can open the text file in the Workspace and copy paste the commands line for line. Press ENTER after each line.

  1. Close Anaconda Prompt.
  2. You can now use conda install -c conda-forge [package name] in Anaconda Prompt to install Python packages. For example, install the package 'pyreadstat'.




Script to type

Type this line by line with every line followed by ENTER.
  1. conda config --prepend channels conda-forge
  2. conda config --append channels defaults
  3. conda config --set channel_priority flexible
  4. conda config --set proxy_servers.http http://proxy.mydre.org:3128
  5. conda config --set proxy_servers.https http://proxy.mydre.org:3128
  6. conda config --set ssl_verify false
  7. conda config --set pip_interop_enabled true


Bulk Anaconda Setup for multiple VMs

  1. The above-mentioned steps will create a configuration file, named .condarc, in a specific folder on your computer: C:/Users/USERNAME/.condarc
  2. Copy this .condarc file to C:/ProgramData/conda/. This folder might be hidden, so you'll have to change your computer's settings to show hidden folders. When the C:/ProgramData/conda/ folder doesn't exist on your computer, you'll have to create it yourself. Anaconda will use the .condarc file from this location for its configurations.
  3. Generalize the VM. You can now deploy this template with preset Anaconda proxy settings.


    • Related Articles

    • Python, Anaconda and JupyterLab

      With domain allowlisting now being a self-service feature, this is the preferred option. For proxy settings in Anaconda in combination with domain allowlisting, please follow this article: ...
    • Proxy configurations for connecting to a server or blob

      Version: 2022-11-02 Update: 2022-11-14 Introduction Domain allowlisting is a selfservice feature that is now available on myDRE. As the name implies, domains on the allowlist can be accessed from within the Workspace (you can request specific domain ...
    • Domains to be whitelisted/allowlisted for known applications

      First version: 2022-11-01 Last updated: 2024-11-22 Last change: Added details for cursor.com Introduction This is a community effort, if you experience issues, see mistakes/updates, or have other applications that you do know what to allowlist, ...
    • Turn Proxy Off/On on Linux VM

      1. Log in to the Linux VM 2. Write command sudo nano /etc/environment press enter and enter your password 3. comment out all the content that you find in there e.g #http_proxy="http://127.0.0.1:8080" 4. Press ctrl + x to exit, save with y and press ...
    • Setting proxy configurations for MiKTeX updating

      Updating MiKTeX Introduction If you have installed MiKTeX through Chocolatey, it won't work properly until some updates to the toolkits have been installed. Since this requires at least partial access to the internet, some configuration needs to be ...