cs410
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # CS 410 Python Installation & Setup ## Overview The course uses Python as our language. As software library installation and management can often be tricky, Python supports virtual environments which collect and isolate a set of packages and their versions. CSCI 410 has its own virtual environment to reduce configuration issues. Assignment 0 tasks you with setting up this environment locally. ## Software and Tools - **Python Version**: Python 3.10.6. As our autograder exclusively runs 3.10.6, we will not provide support for other versions of Python. - **Editor**: Visual Studio Code (VSCode), a free cross-platform editor with debugging support. ## Virtual Environment Setup on a Personal Machine ### Preparation 1. Download [VSCode](https://code.visualstudio.com/) if you haven't already. 2. Download the correct version of Python (3.10.6) [here](https://www.python.org/downloads/release/python-3106/). Do this even if you have another version of Python installed on your machine. :::warning **IMPORTANT:** For Windows users, when you first click on the .exe installer, you should make sure the `Add python.exe to PATH` box is checked BEFORE you click "Install Now". ::: ### Creating the Virtual Environment 1. Create a directory for the course: `cd ~/Desktop && mkdir cs410` 2. Download the requirements.txt file below: - [requirements.txt file](https://drive.google.com/file/d/14krDZ2qKeIwkhvJUjCEOek3OFPpcDbbw/view?usp=sharing) <!-- - [m1/m2 Mac](https://drive.google.com/file/d/1DW7crninjQ32IG3stocJTyOwsT5B5r-J/view?usp=sharing) - [Intel Mac](https://drive.google.com/file/d/1gUxM1ukQit2tsB_5XoUzxJRW9hL9nZv5/view?usp=sharing) - [Windows](https://drive.google.com/file/d/13bAz4lPucYXKTECZygeA7n_lbEHmh8Se/view?usp=sharing) --> 3. Put the `requirements.txt` you just downloaded in your new CS410 directory. Store project files in relation to the virtual environment like so: >cs410/ >>|--- cs410env/ >>|--- assignment-1 >>|--- assignment-2 >>|--- ... >>|--- requirements.txt 4. In a VSCode terminal, navigate to the new directory: `cd ~/Desktop/cs410` ::: spoiler Can't find the VSCode terminal? Go to the menu bar -> select `Terminal` -> select `New Terminal`. ::: 5. Create a virtual environment: * Run `python3.10 -m venv cs410_env` (Mac users) * If the above doesn't work, try `py -3.10 -m venv cs410_env` (Windows users) ::: warning **Note:** Make sure you are in the cs410 directory when running the above commands ::: 6. Activate your new environment: - For all Mac users: `source cs410_env/bin/activate` - For Windows users: `cs410_env\Scripts\activate` - For Linux users: `source cs410_env/bin/activate.csh` ::: spoiler Error: running scripts disabled on system If you are running into execution policy restrictions (typically on Windows), follow this [Stack Overflow post](https://stackoverflow.com/questions/67150436/cannot-be-loaded-because-running-scripts-is-disabled-on-this-system-for-more-in) to resolve the issue. ::: Your terminal should look like this when it is activated correctly: ![image](https://hackmd.io/_uploads/B1wH1AE3C.png) 7. Once you have activated your environment, check that the Python version inside the environment is correct: - run `python -v` - towards the end of the terminal output you should see "Python 3.10" - type `exit()` to return to the normal command line 8. Once the environment is activated, run `pip install -r requirements.txt` ### Before Every Assignment: #### Activate the Environment - For all Mac users: `source cs410_env/bin/activate` - For Windows users: `cs410_env\Scripts\activate` ::: spoiler If you encounter issues on Windows - If you encounter `ERROR: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe`, download [Microsoft Build Tools for Visual Studio](https://visualstudio.microsoft.com/visual-cpp-build-tools/ ). During installation, make sure to select the "Desktop Development with C++" workload - If you encounter `ModuleNotFoundError: No module named 'distutils.msvccompiler'`, ensure you have Python version 3.10.6 installed ::: - For Linux users: `source cs410_env/bin/activate.csh` #### Deactiving the Environment To deactivate the environment, use the following terminal commands: - For Mac M1/M2 users: `conda deactivate` - For all other Mac users `deactivate` - For Windows users: `deactivate` ### Enabling Pylint Through the shell script in the previous step, we've already installed PEP8 library, the industry standard Python style guide, for you. Next, you should activate Pylint, a linting tool that automatically checks for semantic and stylistic issues. Linting makes it easier to spot subtle errors and effortlessly follow the [CS410 Style Guide!](https://hackmd.io/45NLg5CbSj6So9GhM_p3Iw?view) Enable Pylint by following these steps: 1. In VSCode, click on the Extensions icon on the left sidebar (it looks like four squares) or press `Ctrl+Shift+X` to open the Extensions tab. 2. Search for Pylint and install it. 3. Double check that the extension is enabled. The extension should now look like this: ![Screenshot 2024-08-06 at 11.06.01 PM](https://hackmd.io/_uploads/r18sNDxcR.png) Once installed, Pylint will highlight errors in your VSCode file with squiggly lines, indicating PEP8 violations. Hover over an underlined issue to see the details. To get a comprehensive list of all errors and warnings for a specific file, run the command `pylint fileName.py` in your terminal. This will print the style errors in your terminal. For more information on using Pylint, visit [this guide](https://archive.mantidproject.org/How_to_run_Pylint.html). ::: danger **Remember:** While Pylint allows you to disable seeing violations, **DO NOT DO DISABLE WARNINGS** for your CS410 work, or you will risk point deductions. :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully