Skip to content

Instantly share code, notes, and snippets.

@josephhardinee
Last active December 15, 2020 17:56
Show Gist options
  • Save josephhardinee/b384a7924faeeea34c12f1a674b6fa69 to your computer and use it in GitHub Desktop.
Save josephhardinee/b384a7924faeeea34c12f1a674b6fa69 to your computer and use it in GitHub Desktop.
Starting up with Python - Some Random tips

A very quick and incomplete guide to starting up with Python

General instructions are

  1. Get Python by choosing one of:
    1. Anaconda. (https://www.anaconda.com/products/individual)
    2. Module that has anaconda (module load anaconda ) if system supports it
  2. Update condarc file (See entry below
  3. Install mamba in base environment ( conda install -c conda-forge mambas
  4. Create virtual environment:
    1. Preferably from an environment.yml
    2. Otherwise with (for example) mamba create -n py3 python=3.8 numpy scipy matplotlb
  5. Activate environment: conda activate py3
  6. Remember to install new packages with mamba (I'd consider just aliasing it)

Condarc

# See https://www.anaconda.com/understanding-and-improving-condas-performance/ for more info.

# help debug channel issues
show_channel_urls: true

# pip will always be installed with python
add_pip_as_python_dependency: true

# strict priority and conda-forge at the top will ensure
# that all of your packages will be from conda-forge unless they only exist on defaults
channel_priority: strict
channels:
  - conda-forge
  - defaults

# when using "conda create" for envs these packages will always be installed
# adjust that list according your needs, the packages below are just a suggestion!
create_default_packages:
  - ipykernel
  - jupyter
  - pip

safety_checks: disabled
auto_activate_base: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment