0% found this document useful (0 votes)
16 views2 pages

Working Environment - Tasks

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Working Environment - Tasks

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Configuration of the working

environment
In-class tasks

1. Verify that the locations of python.exe and pip.exe files have been added to the
Path system variable or to the Path environment variable for the user.
2. Create a directory for the CeneoScraper project. Avoid location in subdirectories
of your home directory (e.g. Desktop, Documents, etc.) because of potential file
access rights issues.
3. In the project directory, configure the venv virtual environment (right-click in the
project directory → Git Bash Here →python -m venv .venv)1.
4. Run Visual Studio Code. If necessary (e.g. if you are starting the IDE for the first
time since installing it):
a. Install Support for Python (Customize → Tools and Languages→ Python).
b. Select the pylint as the default Linter (Ctrl+Shift+p →Select Linter →
pylint); if pylint is not installed, then install it (pip install pylint)2.
c. update pip package version(python -m pip install --upgrade pip).
d. select Git Bash as the default terminal3 (Terminal → New Terminal →
Select Default Shell (Profile) → Git Bash).
5. Open the project directory in Visual Studio Code (File → Open Folder...).
6. Start the virtual environment (source .venv/Scripts/activate).
7. Check currently used python (python --version) and pip4 library (pip --
version) versions.
8. Create a new empty local git repository in the project directory (git init).
9. Set git configuration variables that contain your username and e mail address,
using the data you used to create a GitHub account (git config). 1
page

1 If Python was installed from Microsoft Store, instead of python use py command in each instruction in the
task. If you are working on MacOS use operating system terminal and instead of python and pip commands
use python3 and pip3 respectively. To use virtual environment you must first install virtualenv library
(pip3 install virtualenv) and then create virtual environment for the project (python3 -m virtualenv
.venv).
2If pip is not recognized, make sure that the location of the pip.exe is added to the system variable Path. If
you had to add it, restart your computer and try to install pylint again. If Python was installed from
Microsoft Store, and when you try to call the pip command, you receive a no-access message, try to open the
PowerShell terminal and execute the pip commands in it.
3 If Python was installed from Microsoft Store, the commands py and pip must be called in PowerShell
terminal. In MacOS operating system use default system terminal.
4 Path to pip.exe file should lead to virtual environment of the project

©Cracow University of Economics Prepared by: Katarzyna Wójcik


Computer Programming 2 Configuration of the working environment

10. On GitHub, create a new remote public repository with a name that matches the
project directory name. When creating a repository, create README.md file and
a python .gitignore file by selecting the appropriate checkboxes.
11. Agree on the name of the root branch in the remote and local repository (either
set the master name for your new github repositories, or rename the root branch
in the local project5 (git branch -M main).
12. Add the RSA public key generated for your computer to GitHub and/or generate a
Personal access token for your GitHub account if you haven't already done it.
13. Bind the remote repository to the local one (git remote add origin). Use the
remote repository address that corresponds to the authentication method you
selected (SSH or Personal access token key).
14. If you plan to use authentication via Personal access token, set git configuration
variable indicating wincred as credential manager.
15. Download changes from the remote repository to the local one (gitpull).
16. Add .vscode entry to .gitignore.
17. Create a file in your project named main.py.
18. Add changes (file main.py and entry in .gitignore file; git add).
19. Create a project current state record (git commit).
20. Send changes to the remote repository (git push).
21. Make sure that the virtual environment is running and that the default
interpreter for your project is Python from the virtual environment.
22. Close Project Directory (File →Close Folder... ).

2
page

5This operation will not be necessary if during the installation of the Git name main has been selected as
the default name of the root branch of all new projects.

©Cracow University of Economics Prepared by: Katarzyna Wójcik

You might also like