Content pfp
Content
@
0 reply
0 recast
2 reactions

dunklow75👟 pfp
dunklow75👟
@dunklow75.eth
How to set up a project with a virtual environment and Git in Visual Studio Code 🧵(1/2) 1. Open your working folder in Visual Studio Code • Open your terminal. 2. Initialize Git: • Run git init to start using Git in the project. • Don’t forget to create a .gitignore file to exclude files you don’t want in Git (like virtual environments). 3. Why do we need a virtual environment? • To isolate package installations. • It helps keep different projects on your computer separate and clean. 4. Creating a virtual environment: • Run python -m venv ./env to create a folder named env. 5. Activating the virtual environment: • Run source env/bin/activate to activate it. • To deactivate, simply run deactivate.
0 reply
0 recast
0 reaction

dunklow75👟 pfp
dunklow75👟
@dunklow75.eth
6. Installing packages: • Create a requirements.txt file to keep track of the packages and versions your project needs. • Format: package_name==version • Install the packages by running pip install -r requirements.txt. • Create a file like main.py and import your installed packages to make sure they’re working in the environment. 7. Setting up a .env file: • Use a .env file to store sensitive information like API keys (e.g., OPENAI_API_KEY="sk-....."). • Add .env to your .gitignore file to keep it from being uploaded to GitHub.
0 reply
0 recast
0 reaction