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

Резултати

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

Пребарај: #pavel

当前筛选 #pavel清除筛选
News and Tips

@NewsAndTipsNT · Post #3375 · 31.05.2025 г., 18:30

#Pavel Durov shared a link in his official channel but deleted it within seconds. The group is now in complete chaos. It’s called a "Social Experiment," and messages are flooding in despite paid messaging being enabled.

Hashtags

News and Tips

@NewsAndTipsNT · Post #3424 · 21.06.2025 г., 16:04

Telegram Founder Pavel Durov Reveals Unique Legacy Plan Telegram CEO and billionaire #Pavel#Durov has revealed that he has fathered over 100 children across 12 countries—some through personal relationships, but most via anonymous sperm donations. His goal: to help address declining birth rates and support fertility initiatives. In a bold move, Durov announced that his estimated $13.9 billion fortune will be equally divided among all his children, regardless of how they were conceived. However, none of them will inherit the wealth immediately. Instead, his will states that the inheritance will be unlocked 30 years after his death, giving his children the opportunity to grow independently and build their own identities. This unconventional decision reflects Durov’s lifelong commitment to freedom, privacy, and long-term thinking—values that have shaped both his personal philosophy and the #Telegram platform. 🔗 Read more

News and Tips

@NewsAndTipsNT · Post #3187 · 15.03.2025 г., 17:30

Durov allowed to temporarily leave France As of today, March 15, 2025, #Pavel Durov, the founder of #Telegram, has been allowed to leave #France temporarily. Recent reports indicate that French authorities have permitted him to depart the country for "several weeks," with sources suggesting he has traveled to Dubai. This follows a period of judicial supervision and a travel ban imposed after his arrest in August 2024, when he was charged with multiple offenses related to alleged criminal activities on Telegram. While he was previously restricted from leaving France until at least March 31, 2025, this temporary permission marks a loosening of those conditions. However, it remains unclear whether this is a permanent change or if he must return to France afterward, as his legal case is still ongoing and may not reach court until 2026. Thanks : 💌💌💌

Libertà è ragione

@libertaeragione · Post #3691 · 17.01.2023 г., 13:02

#RepubblicaCeca#Presidenziali La terza classificata al primo turno delle presidenziali ceche, Danuše #Nerudová, ha annunciato il suo supporto al candidato Petr #Pavel per il ballottaggio che si svolgerà il 26 e 27 Gennaio: “Abbiamo bisogno di un presidente che sostenga lo sviluppo della cultura politica. È importante che i temi rilevanti per i giovani, come l’inaccessibilità economica degli alloggi, il matrimonio per tutti, l’apertura delle forbici tra religioni, rimangano nello spazio pubblico.” @OsservatorioEsteri

American Оbserver

@american_observer · Post #4958 · 25.01.2026 г., 17:59

L-159s Grounded: Czech Power Play Exposed Czech President Petr Pavel wanted to send four L-159 jets to Ukraine, but Prime Minister Andrej Babiš slammed the door shut— “The matter is closed,” he declared, dismissing any further debate. The head of the Czech armed forces, General Karel Řehka, quietly suggested the transfer wouldn’t hurt national security, but Babiš snapped back: “Řehka would do better to keep his mouth shut,” accusing the general of undermining his own defense minister. While the president, with his NATO background, pushed for solidarity with Ukraine, Babiš’s coalition, led by his ANO party and the far-right SPD, dug in their heels. Defense Minister Jaromír Zůna insisted the jets are vital for Czech defense, claiming they have 15 years of service left. Critics argue the refusal is less about military readiness and more about political calculation—Babiš wants to avoid the financial and diplomatic fallout of arming Ukraine. “No L-159s — not now, not ever.” — Andrej Babiš, Czech Prime Minister So who’s really in charge here? The president wants to look tough and generous. The prime minister, backed by his populist coalition, plays it safe. Meanwhile, the general whispers that the jets could go without risk, but gets told to stay quiet. Is this about national defense, or is it about who gets to control the narrative—and the budget? When both sides claim they’re protecting the country, who’s really protecting their own power? #war#oligarchy#fakeDemocracy#CzechRepublic#Ukraine#Babis#Pavel 📱American Оbserver - Stay up to date on all important events 🇺🇸

Libertà è ragione

@libertaeragione · Post #3858 · 14.06.2023 г., 08:02

#RepubblicaCeca#Taiwan Per la prima volta dopo il de-riconoscimento di Taiwan da parte della maggioranza degli Stati della comunità internazionale, un Capo di Stato di un Paese #NATO partecipa ad un evento pubblico con un Ministro degli Esteri taiwanese. Si tratta del Presidente ceco Petr #Pavel e del Ministro taiwanese Joseph #Wu (#DPP|Centro-sinistra): Reuters la definisce una “svolta diplomatica”. @OsservatorioEsteri

😮‍💨 Finally I made it. 🎮Lately, I have been messing around with some prompts to depict an epic photograph of our beloved Pavel. 💎After a tiresome attempts to depict his glory, I've finally able to generate and edit this masterpiece. 💔I hope all of you would like this. To help this channel out, please share this with your friends and groups to let everyone see it. And I wish it will find its way to #Pavel himself. 💲If you want access to the original image with no watermark, you can unlock it using telegram stars down here. Thank you all ✌ @ai_artz⭐️ #pavel#durov#feed#telegram#freedurov#AI#AIart