Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+6 votes
asked ago in CSC 305 Fall 2024 by (1.4k points)

1 Answer

+3 votes
 
Best answer

If you followed the directions in the tutorial (linked at the top of main.py) to install the libraries in a virtual environment, then when you go back to a terminal later, you should just be able to run the single command to "activate" that python environment.

To activate the virtual environment:

On Windows:

  • venv\Scripts\activate

On macOS/Linux:

  • source venv/bin/activate

Alternatively, if you just install the libraries globally (running pip install fastapi uvicorn websockets without creating or activating a virtual environment) then that should work too, and you shouldn't need to keep installing things or activating the virtual environment.

(Installing libraries globally on your system can get messy, though, if you're working on a lot of different python projects that might require different versions of the libraries... but that's usually only an issue for professional developers who work on a lot of python projects at the same time.)

answered ago by (3.2k points)
selected ago by
...