Last active
July 11, 2025 11:07
-
-
Save x-treme-dev/bceefed7c7edd923f42f87552d4591e5 to your computer and use it in GitHub Desktop.
python install to windows & install environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. https://www.python.org/ - download latest version | |
2. run exe-file | |
3. Put Checks: Use admin privileges when installing py.exe & Add python.exe to PATH | |
4. Choise Custom installation, Next, Choise in next window: Python 3.13 for all users | |
5. Оpen cmd or PowerShell and tap: python --version | |
6. In Menu Run find IDLE (Python 3.13 64-bit) | |
################################################################################################################### | |
Развернуть окружение для python | |
In project directory | |
Win: python -m venv venv | |
Linux: python3 -m venv venv | |
Run | |
Win: venv\Scripts\activate | |
Linux: source venv/bin/activate | |
Download libraries | |
(venv) pip freeze - to see virtual environment | |
(venv) pip install -U pip setuptools - upgrade libraries | |
(venv) pip install requests lxml - download libraries requests & lxml | |
(venv) pip uninstall lxml -y - remove library lxml | |
(venv) touch main.py - create exe-file | |
Turn off venv | |
(venv) deactivate | |
catalogs tree: | |
venv (catalog) | |
main.py | |
########################################### | |
Test of exe-file main.py | |
import requests | |
def main(): | |
return requests.get('https://google.com') | |
if _name_ = '_main_' | |
print(main()) | |
#output <Request[200]> | |
############################################# | |
Create file of dependencies | |
(venv) pit freeze > requirements.txt | |
In requirements.txt delete line pkg_resources==0.0.0 | |
Создан файл с зависимостями. Теперь достаточно передать файл | |
с зависимостями и исполянемый скрипт. На другом компьютере | |
все зависимости установятся из requirements.txt | |
In project directory | |
Win: python -m venv venv | |
Linux: python3 -m venv venv | |
Run | |
Win: venv\Scripts\activate | |
Linux: source venv/bin/activate | |
To install libraries | |
(venv) pip install -r requirements.txt | |
(venv) pip freeze - to see virtual environment | |
Создание .exe-файла | |
После того как написано приложение, убедимся, что все модули установлены (в директории с проектом) | |
pip3 freeze | |
pip install auto-py-to-exe | |
python -m auto_py_to_exe | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Создание приложения для настольного ПК