Skip to content

Commit 490d976

Browse files
authored
Merge pull request #493
adding environment.yml and instructions
2 parents 35b1876 + 1c89e69 commit 490d976

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

_includes/scripts/check_env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def check_import(packagename):
1515
all_checks_passed = True
1616

1717
# Throw error if Anaconda is not default Python
18-
assert 'anaconda' in sys.prefix, ("Anaconda is NOT installed as your "
18+
assert 'anaconda' in sys.prefix.lower(), ("Anaconda is NOT installed as your "
1919
"default version of Python. Please "
2020
"make sure that is in accordance "
2121
"with the instructions provided.")
@@ -24,7 +24,7 @@ def check_import(packagename):
2424
assert sys.version_info.major >= 3, 'Please install Python 3!'
2525

2626
# Packages necessary for workshop
27-
packages = ['numpy', 'matplotlib', 'pandas', 'jupyter', 'ggplot']
27+
packages = ['numpy', 'matplotlib', 'pandas', 'jupyter', 'plotnine']
2828

2929
# Throw error if any of the necessary packages is not installed
3030
for p in packages:

environment.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: python-ecology-lesson
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.8
7+
- jupyter
8+
- pandas
9+
- numpy
10+
- matplotlib
11+
- plotnine

setup.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,28 @@ conda install -c conda-forge plotnine
169169
~~~
170170
{: .language-bash}
171171
172+
### _(Alternative)_ Installing required packages with environment file
173+
Download the
174+
[environment.yml](https://raw.githubusercontent.com/datacarpentry/python-ecology-lesson/gh-pages/environment.yml)
175+
file by right-clicking the link and selecting save as.
176+
In the directory where you downloaded the environment.yml file run:
177+
178+
~~~
179+
conda env create -f environment.yml
180+
~~~
181+
{: .language-bash}
182+
183+
Activate the new environment with:
184+
~~~
185+
conda activate python-ecology-lesson
186+
~~~
187+
{: .language-bash}
188+
189+
You can deactivate the environment with:
190+
~~~
191+
conda deactivate
192+
~~~
193+
{: .language-bash}
172194
173195
## Launch a Jupyter notebook
174196

0 commit comments

Comments
 (0)