Skip to content

Instantly share code, notes, and snippets.

@Rafat97
Last active January 13, 2021 15:10
Show Gist options
  • Save Rafat97/8270adfde50a2537f584d26d258d5d75 to your computer and use it in GitHub Desktop.
Save Rafat97/8270adfde50a2537f584d26d258d5d75 to your computer and use it in GitHub Desktop.

😍 Some Important Things of Conda 😍

# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
#To export environment file
activate <environment-name>
conda env export > <environment-name>.yml
#For other person to use the environment
conda env create -f <environment-name>.yml
#For removing environment
conda env remove -n <environment-name>
# It is for demo. You must change this file based on working process
# Create a conda environment for python in docker
version: "3.3"
networks:
docker-network:
services:
web:
build:
context: .
dockerfile: ./Dockerfile
command: python app.py
restart: always
tty: true
volumes:
- .:/home/face
ports:
- "7080:5000"
networks:
- docker-network
FROM continuumio/miniconda3
WORKDIR /app
# Create the environment:
# COPY environment.yml .
# RUN conda env create -f environment.yml
RUN conda create --name myenv python=3.6
# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment