Skip to content

Instantly share code, notes, and snippets.

@maxfil333
maxfil333 / Activate_virtualenv.txt
Last active June 20, 2024 08:01
Activate virtualenv
Для того чтобы установить библиотеки в виртуальное окружение (venv) в PyCharm, следуйте этим шагам:
Создайте виртуальное окружение:
Откройте терминал в PyCharm.
Введите следующую команду для создания виртуального окружения в вашем проекте:
bash
Copy code
@maxfil333
maxfil333 / jupyter D.txt
Last active June 20, 2024 08:01
jupyter D.txt
создать ярлык на рабочем столе:
C:\Users\user\anaconda3\Scripts\jupyter-notebook-script.py --notebook-dir="D:\\CODE"
расположение файла (строка C:\Users\user\anaconda3\Scripts\jupyter-notebook-script.py)(может отличаться):
Пуск - Jupyter Notebook- перейти к расположению - свойства - ярлык - объект
OR
Jupyter notebook -> terminal -> jupyter notebook --notebook-dir="D:\\filippMI"
@maxfil333
maxfil333 / pip_mirror.txt
Last active June 20, 2024 08:02
pip mirror.txt
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
1. (CMD) -> OK X: \\10.10.0.3\docs Microsoft Windows Network
net use
2. (terminal)
pyinstaller --add-data "C:\Program Files\Tesseract-OCR;Tesseract-OCR" --onefile main.py
3) (terminal) -> main.spec
pyi-makespec main.py
0. Вход
User/.git-credentials: записать одну строку
https://maxfil333:YOURTOKEN@github.com
1. Восстановить до состояния последнего коммита
git reset --hard HEAD
2. Удалить файл из индекса
git reset / git reset <file>
1. Получить .spec файл командой
pyinstaller --onefile src/main.py
2. Добавить в datas .spec файла пути
datas=[
('C:\\Program Files\\poppler-22.01.0\\Library\\bin', 'poppler'),
('src', 'src'),
('config', 'config'),
from time import perf_counter
import torch
device = 'cpu' # cpu
a = torch.randn(7000,5000).to(device)
b = torch.randn(5000,7000).to(device)
print(a.device, b.device)
start = perf_counter()
a @ b