TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #210 · 3 фев.

Что делать если нужно поставить какую-то Python-библиотеку а root-прав нет? То есть в систему библиотеку никак и ничего не поставить. Есть как минимум два способа это решить правильно! 🔸 Сделать виртуальное окружение и ставить там что угодно. Это позволит создать полностью независимое исполняемое окружение для ваших приложений. Все библиотеки будут храниться в домашней директории юзера а значит доступ на запись имеется. Создать очень просто: python3 -m venv ~/venvs/myenvname Теперь активируем окружение # Linux source ~/venvs/myenvname/bin/activate # Windows %userprofile%\venvs\myenvname\Scripts\activate.bat Можно ставить любые библиотеки и запускать приложение. Это стандартный метод работы с любым проектом. Если еще не используете его, то пора начинать. Даже при наличии root доступа! 🔸 Бывает, что нет возможности запустить приложение из своего виртуального окружения. Например, его запускает какой-то сервис от вашего юзера и вставить активацию окружения вы не можете. В этом случае можно установить библиотеки для Python не глобально в систему, а только для юзера. Выполните этот код в консоли: python3 -m site Вы получите что-то такое: sys.path = [ '/home/user', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/user/.local/lib/python3.7/site-packages', ... ] USER_BASE: '/home/user/.local' USER_SITE: '/home/user/.local/lib/python3.7/site-packages' ENABLE_USER_SITE: True Нас интересует параметр USER_SITE. Это путь к пользовательским библиотекам, которые доступны по умолчанию, если они есть. Именно сюда будут устанавливаться модули если добавить флаг --user при установке чего-либо через pip pip install --user requests Для этой команды не нужны root-права. После неё можно запускать системный интерпретатор без виртуальных окружений и установленная библиотека будет доступна для текущего юзера. Параметр USER_BASE показывает корневую директорию для хранения user-библиотек. Её можно изменить с помощью переменной окружения PYTHONUSERBASE export PYTHONUSERBASE=~/pylibs python3 -m site ... USER_BASE: '/home/user/pylibs' USER_SITE: '/home/user/pylibs/lib/python3.7/site-packages' Получается некоторое подобие виртуального окружения для бедных 😁 которое можно менять через эту переменную (не делайте так!Лучше venv!) 🔸 Дописывание пути в PYTHONPATH Этот способ не входит в список "двух правильных", но тоже рабочий. Здесь придётся сделать всё несколько сложней. Сначала ставим библиотеку в любое место указывая путь установки pip3 install -t ~/mylibs modulename Библиотека установится без привязки к какому-либо интерпретатору. То есть по умолчанию не будет видна. Теперь в нужный момент добавляем этот путь в sys.path или в PYTHONPATH. Не буду советовать так делать. Единственный раз когда этот способ мне пригодился и решил поставленную задачу, это при создании общей библиотеки для кластера компьютеров. Модули лежат в сети и подгружаются для всех из одного и того же места. То есть обновлять файлы требуется только один раз а не на всех хосты отдельно. Минусы такого подхода: ▫️Нужно всем хостам пробить нужный путь в .bashrc или ещё куда-то чтобы он сетапился на старте. ▫️Чем больше хостов тем больше нагрузка на сеть. Иногда такой способ не подходит именно по этой причине. Тогда Ansible вам в помощь. ▫️Не очень подходит если хосты с разными операционками. Некоторые библиотеки различаются для Linux и Windows (там, где есть бинарники) и приходится мудрить более сложные схемы. #tricks#basic

Резултати

Пронајдени 12 слични објави

Пребарај: #aospa

当前筛选 #aospa清除筛选
Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #280 · 14.04.2024 г., 15:40

Paranoid Android Uvite - Official | Android 14 | Nothing Phone (2) ✍️ Details: • Version: Uvite Beta 2.1 • Device: #Pong • Released: 15/04/24 🔽 Download: Here 😅 Support Threads: TG | XDA ⚙️ Installation: Here (Based on 2.5.3 firmware) 📕Tags: #AOSPA#Official#U#CLO#stayparanoid ✨Changelogs: Beta 2: * Updated blobs and firmware to 2.5.3 * Integrated the April 2024 security patch. * Fingerprint sensor is way snappier now. * Upstreamed kernel to latest CLO and ACK tags. * Battery backup is improved by a lot. * Certain improvements are done to the glyph interface. * Improved statusbar and rounded corner paddings. Beta 2.1: - Hotfix to fix safetynet cts profile ✍️Notes: - Flash the NOS 2.5.3 firmware via fastboot preferably if not on that firmware. - OTA system is not ready yet, so the next build will need to be flashed manually. 😎 Maintainer: @gotenksIN | @kunmun36 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #251 · 20.02.2024 г., 07:59

Paranoid Android Uvite - Official | Android 14 | Nothing Phone (2) ✍️ Details: • Version: Uvite Beta 1 • Device: #Pong • Released: 20/2/24 🔽 Download: Here 😅 Support Threads: TG | XDA 📕Tags#AOSPA#Official#U#stayparanoid#CLO ✨Changelogs: - Initial public build. ⚙️Installation: ✔️Make sure you have the latest platform-tools and Google USB Drivers installed. Proceed with the fastboot package installation as follows 1. Reboot to bootloader. 2. Execute this for flashing the ROM: fastboot update --skip-reboot path/to/aospa_zip 3. Enter Recovery. 4. Go to Wipe Data \ Factory Reset to format. 5. Reboot to System. ✍️Notes: - This is based on NOS 2.5.2, flash the firmware via fastboot preferably if not on that firmware. - This build does not have OTA, so the next build will need to be flashed manually. 🏆Credits: - Fabian for PA Glyph Implementation. - Hellboy for his assistance in improving FOD dimming. - Contributors from Pong TG Community. 😎 Maintainer: @gotenksIN | @kunmun36 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #333 · 24.06.2024 г., 05:44

Paranoid Android Uvite - Official | Android 14 | Nothing Phone (2) ✍️ Details: • Version: Uvite Beta 3.1 • Device: #Pong • Released: 24/06/24 🔽 Download: Here 🆘 Support Threads: TG | XDA ⚙️ Installation: Here 🔖Tags: #AOSPA#Official#U#CLO#stayparanoid#NothingPhone2 ✨Changelogs: - Merged latest ACK tag for kernel and newer CLO tag for kernel DTS - Various improvements to battery life - Improvements for fingerprint sensor ✍️Notes: - OTA system is not ready yet, so the next build will need to be flashed manually 😎 Maintainer: @gotenksIN | @kunmun36 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #329 · 19.06.2024 г., 15:36

Paranoid Android Uvite - Official | Android 14 | Nothing Phone (2) ✍️ Details: • Version: Uvite Beta 3 • Device: #Pong • Released: 19/06/24 🔽 Download: Here 🆘 Support Threads: TG | XDA ⚙️ Installation: Here 🔖Tags: #AOSPA#Official#U#CLO#stayparanoid#NothingPhone2 ✨Changelogs: - Updated blobs and firmware to 2.5.6 - Merged latest CLO and ACK tags for kernel - Improved stability and system performance ✍️Notes: - OTA system is not ready yet, so the next build will need to be flashed manually 😎 Maintainer: @gotenksIN | @kunmun36 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #588 · 06.04.2025 г., 08:31

Paranoid Android - Unofficial | Android 15 | Nothing Phone (2) 📔Details: • Version: Vauxite (Alpha) • Device: #Pong • Updated: 06/04/25 🔽 Download: Here 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#V#CLO#stayparanoid#NothingPhone2 ✨Changelogs: - Update to LA.QSSI.15.0.r1-14800-qssi.0 (includes March SPL) - Remove Light theme QS for now - Fixes for left volume panel - Upgrading from Uvite no longer clears fingerprints - Improvements to performance and system stability ⚙️Installation: 1. Make sure OEM unlocking is turned on from dev options in your current ROM. 2. Reboot to bootloader 3. Unlock critical partitions using: fastboot flashing unlock_critical (The build ships fw if your are wondering why) 4. Execute this for flashing the ROM: fastboot -w (wipes data) fastboot update path/to/aospa zip 5. Wait for boot to finish ✍️ Note: - "While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks" - "It should automatically start passing play integrity sometime soon as well" - Firmware is included. No need to flash seperately. - Dirty flashing from previous build is possible. 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #568 · 27.02.2025 г., 18:49

Paranoid Android - Unofficial | Android 15 | Nothing Phone (2) 📔Details: • Version: Vauxite (Alpha) • Device: #Pong • Updated: 28/02/25 🔽 Download: Fastboot Build 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#V#CLO#stayparanoid#NothingPhone2 ✨Changelogs: 04/03 - Update to LA.QSSI.15.0.r1-14000-qssi.0 (includes Feb SPL) - Improvements to performance and system stability 28/02 - Add light theme for QS - Improved UI in ThemePicker for custom options - Add Circle to Search - Misc Launcher improvements 27/02 - Merge KERNEL.PLATFORM.1.0.r3-05800-kernel.0 - Improved UI performance and power consumption ⚙️Installation: 1. Reboot to bootloader 2. Execute this for flashing the ROM: fastboot -w (wipes data) fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - "While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks" - Firmware is included. No need to flash seperately. - Dirty flashing from previous build is possible. 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #534 · 28.01.2025 г., 13:07

Paranoid Android Vauxite - Unofficial | Android 15 | Nothing Phone (2) 📔Details: • Version: Vauxite (Alpha) • Device: #Pong • Updated: 05/02/25 🔽 Download: Fastboot Build 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#V#CLO#stayparanoid#NothingPhone2 ✨Changelogs: 05/02: - Merge KERNEL.PLATFORM.1.0.r3-05700-kernel.0 - Update kernel to android12-5.10 November 2024 release 8 03/02 - Update to LA.QSSI.15.0.r1-13300-qssi.0 (includes Jan SPL) 30/01 - Build kernel inline with ROM, rebased on LA.VENDOR.1.0.r1-26900-WAIPIO.QSSI15.0 28/01 - Some kernel stuff - Add more information to Battery Information page - Add PowerOffAlarmService - Allow adding/removing tiles with one click ⚙️Installation: 1. Reboot to bootloader 2. Execute this for flashing the ROM: fastboot -w (wipes data) fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - "While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks" - Firmware is included. No need to flash seperately. - Dirty flashing from previous build is possible. 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #519 · 21.01.2025 г., 15:02

Paranoid Android Vauxite - Unofficial | Android 15 | Nothing Phone (2) 📔Details: • Version: Vauxite (Alpha) • Device: #Pong • Updated: 22/01/25 🔽 Download: Fastboot Build 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#V#CLO#stayparanoid#NothingPhone2 ✨Changelogs: 22/1 - Improved power consumption during video playback - Utilise ADSP-backed Charge Control mechanism (thanks to @arter97) - Statusbar Icon related fixes - Improve scrolling - Add Screen Off UDFPS (In Settings -> Security -> Fingerprint) - Add custom vibration patterns - Perform prox sensor checks for single/double tap - Fix haptics while ending call 21/1 - Update proprietary files to Update to Pong-V3.0-250113-1723 - UDFPS layout related fixes (in biometric prompt, lockscreen etc) - Fix Statusbar, Navbar theme in Settings - Other minor fixes ⚙️Installation: 1. Reboot to bootloader 2. Execute this for flashing the ROM: fastboot -w (wipes data) fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - "While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks" - Firmware is included. No need to flash seperately. - Dirty flash from previous build is possible. 😎 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #512 · 13.01.2025 г., 17:35

Paranoid Android Vauxite - Unofficial | Android 15 | Nothing Phone (2) 📔Details: • Version: Vauxite (Alpha) • Device: #Pong • Updated: 20/01/25 🔽 Download: [Fastboot | Recovery] Build 🆘 Support: Here 🔖Tags: #AOSPA#Unofficial#V#CLO#stayparanoid#NothingPhone2 ✨Changelogs: 20/01 - Add Wifi/Mobile Data tiles - Fix NFC tile reliability - Add Face Unlock 15/01 - Added Status Bar Tuner - Show Bluetooth devices' battery level in status bar 13/01 - Recovery is now just as capable as it was in Uvite - Added pocket mode - Fixed few random issues 10/1 - Updated system side blobs - Moved to latest NOS3.0 blobs & firmware ⚙️Installation: 1. Reboot to bootloader 2. Execute this for flashing the ROM: fastboot -w (wipes data) fastboot update path/to/aospa zip 3. Wait for boot to finish Dirty flash from previous update is possible using: fastboot update path/to/aospa zip ✍️ Note: - "While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks" - Firmware is included. No need to flash seperately. 😎 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #740 · 06.05.2026 г., 07:29

Paranoid Android - Unofficial | Android 16 | Nothing Phone (2) 📔Details: • Version: Beryl (Alpha) • Device: #Pong • Updated: 13/05/26 🔽 Download: Here | Sideload 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#Baklava#CLO#NothingPhone2#Beryl ✨ Changelogs - Fixed upstream tethering apex failing to boot - Improvements to performance and system stability ⚙️Installation: 1. fastboot flashing unlock_critical (skip if already unlocked) 2. Execute this for flashing the ROM: fastboot -w fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - Firmware is included. No need to flash seperately. - Clean flash is recommended 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #736 · 02.05.2026 г., 05:06

Paranoid Android - Unofficial | Android 16 | Nothing Phone (2) 📔Details: • Version: Beryl (Alpha) • Device: #Pong • Updated: 04/05/26 🔽 Download: Here 🆘 Bug Reports: Here ✨ Changelogs: Here 🔖Tags: #AOSPA#Unofficial#Baklava#CLO#NothingPhone2#Beryl ⚙️Installation: 1. fastboot flashing unlock_critical (skip if already unlocked) 2. Execute this for flashing the ROM: fastboot -w fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - Firmware is included. No need to flash seperately. - Clean flash is recommended 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #700 · 19.12.2025 г., 14:30

Paranoid Android - Unofficial | Android 16 | Nothing Phone (2) 📔Details: • Version: Beryl (Alpha) • Device: #Pong • Updated: 19/12/25 🔽 Download: Here 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#Baklava#CLO#NothingPhone2#Beryl ✨Changelogs: - Based on current QSSI16 and V4.0-251119-1654 - Improvements to performance and system stability - While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks ⚙️Installation: 1. fastboot flashing unlock_critical (skip if already unlocked) 2. Execute this for flashing the ROM: fastboot -w fastboot update path/to/aospa zip 3. Wait for boot to finish ❗️Known bugs: - UW camera does not show up in aperture - Left volume panel isn't aligned in landscape ✍️ Note: - Firmware is included. No need to flash seperately. - Clean flash is recommended 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2