-
-
Notifications
You must be signed in to change notification settings - Fork 43
Update setup: control python version, explicit data folder, instructions for colab, and more #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update setup: control python version, explicit data folder, instructions for colab, and more #587
Conversation
1. Create folder for workshop - store data and venv folder 2. Call virtual environment folder "venv", following conventions 3. Require Python 3.11.9. Newer versions of Python are not yet compatible with Tensorflow
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/carpentries-lab/deep-learning-intro/compare/md-outputs..md-outputs-PR-587 The following changes were observed in the rendered markdown documents: What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2025-05-18 20:17:35 +0000 |
carschno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, apologies for the late review.
I have left a few suggestions, mostly about using .venv instead of venv.
| ```shell | ||
| py -m venv dl_workshop | ||
| # Use python3 or py instead if one of them points to 3.11.9. | ||
| python -m venv venv # 1st "venv" is commmand, 2nd venv is name of the virtual environment / folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guide linked above uses .venv as environment folder, which has become best practice. The downside is (on purpose) that the folder is invisible by default, but I think I would prefer sticking with the instructions to avoid confusion.
| python -m venv venv # 1st "venv" is commmand, 2nd venv is name of the virtual environment / folder | |
| python -m venv .venv |
| ```shell | ||
| python3 -m venv dl_workshop | ||
| python --version | ||
| py --version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line has potential for confusion. Where does a py binary come from? Is it likely to occur when following the instructions above?
| py --version |
|
|
||
| Open a terminal and run the following commands. | ||
|
|
||
| 1. Create a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments) called `venv` using the "venv" command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Create a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments) called `venv` using the "venv" command: | |
| 1. Create a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments) using the "venv" command: |
| If you run the `ls` command from `~/Desktop/dl_workshop`, you should see a new `venv` folder inside it | ||
|
|
||
| ```shell | ||
| ls | ||
| ``` | ||
|
|
||
| ```output | ||
| venv/ | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with my suggestions above, and for conciseness:
| If you run the `ls` command from `~/Desktop/dl_workshop`, you should see a new `venv` folder inside it | |
| ```shell | |
| ls | |
| ``` | |
| ```output | |
| venv/ | |
| ``` | |
| If you run the `ls` command from `~/Desktop/dl_workshop`, you should see a new `.venv` folder inside it | |
| ```shell | |
| ls -a -d .venv |
.venv
|
|
||
| ```shell | ||
| source dl_workshop/bin/activate | ||
| source venv/bin/activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| source venv/bin/activate | |
| source .venv/bin/activate |
|
|
||
| ```shell | ||
| dl_workshop\Scripts\activate | ||
| venv\Scripts\activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| venv\Scripts\activate | |
| .venv\Scripts\activate |
| If you're using Git Bash on Windows, you need to add the source command first. | ||
|
|
||
| ```shell | ||
| source venv/Scripts/activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| source venv/Scripts/activate | |
| source .venv/Scripts/activate |
| Remember that you need to activate your environment every time you restart your terminal! | ||
| **Note**: Remember that you need to activate your environment every time you restart your terminal, and before you launch Jupyter Lab! | ||
|
|
||
| 3. After activating the enviornment, upgrade pip. This is a good practice to follow when you first initialize your virtual environment (beforing installing additional packages). [Pip](https://pip.pypa.io/en/stable/) is the package management system built into Python.Pip should be available in your system once you installed Python successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo:
| 3. After activating the enviornment, upgrade pip. This is a good practice to follow when you first initialize your virtual environment (beforing installing additional packages). [Pip](https://pip.pypa.io/en/stable/) is the package management system built into Python.Pip should be available in your system once you installed Python successfully. | |
| 3. After activating the environment, upgrade pip. This is a good practice to follow when you first initialize your virtual environment (beforing installing additional packages). [Pip](https://pip.pypa.io/en/stable/) is the package management system built into Python.Pip should be available in your system once you installed Python successfully. |
|
|
||
| 4. Install the required packages: | ||
|
|
||
| Follow the OS-specific instructions below. NOte that It may take 10-20 minutes to install everything. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Follow the OS-specific instructions below. NOte that It may take 10-20 minutes to install everything. | |
| Follow the OS-specific instructions below. Note that it may take 10-20 minutes to install everything. |
The key change here is that I require learners to download Python 3.11.9, which is compatible with Tensorflow and Keras. Newer versions of Python may run into some issues. There are a few other minor changes to the setup — let me know if you want this broken into multiple pull request. I'll summarize below: