Creating virtual environment
$ mkdir python_demo
$ cd python_demo
don't forget to update name of environment name, and i added
pip
,ptvsd
packages to debug azure function.
$ cat > environment.yml <<EOL
name: python_demo-3.9
channels:
- defaults
dependencies:
- python=3.9
- pip
- pip:
- ptvsd
EOL
$ conda env create -f environment.yml
Collecting package metadata (repodata.json): done
Solving environment: done
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Installing pip dependencies: - Ran pip subprocess with arguments:
['/opt/homebrew/Caskroom/miniconda/base/envs/python_azure_function_conda_virtual_env-3.9/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/kenanhancer/Documents/projects/python-projects-kenanhancer/python_azure_function_conda_virtual_env/condaenv.5uk0y5ie.requirements.txt', '--exists-action=b']
Pip subprocess output:
Collecting ptvsd (from -r /Users/kenanhancer/Documents/projects/python-projects-kenanhancer/python_azure_function_conda_virtual_env/condaenv.5uk0y5ie.requirements.txt (line 1))
Using cached ptvsd-4.3.2-py2.py3-none-any.whl (4.9 MB)
Installing collected packages: ptvsd
Successfully installed ptvsd-4.3.2
done
#
# To activate this environment, use
#
# $ conda activate python_azure_function_conda_virtual_env-3.9
#
# To deactivate an active environment, use
#
# $ conda deactivate
Continue reading