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

Резултати

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

Пребарај: #refugees

当前筛选 #refugees清除筛选
Amazing Geography 🌍

@amazingeo · Post #210 · 10.09.2025 г., 09:12

🌍 In 2022, Turkey hosted the largest refugee population in the world, with over 3.6 million people—mainly from Syria—reshaping cities and services in the region. ✨ #migration⚡#refugees⚡#population⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #442 · 08.11.2025 г., 20:31

🌍 Since 2015, South Sudan has seen one of the world’s fastest-growing refugee crises, with over 2 million people fleeing to neighboring countries—reshaping migration patterns in East Africa. ✨ #migration⚡#refugees⚡#Africa⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

New Eastern Outlook

@neweasternoutlook · Post #12204 · 18.02.2026 г., 12:49

🏴🎖ISIS’s New Wave of Activity: Tactics, Threats, and Responses A renewed surge of asymmetric attacks in Iraq and Syria suggests that ISIS is testing its resilience, exploiting instability, and seeking to reassert psychological and operational relevance ✍️Samyar Rostami is a political observer and senior researcher in international relations ➡️In recent months, Islamic State has intensified operations across desert corridors in Iraq’s Anbar and Salah ad-Din provinces while reactivating sleeper cells in northern and eastern Syria. Rather than attempting territorial control, the group relies on cost-effective asymmetric tactics — roadside bombs, targeted assassinations, and hit-and-run attacks — aimed at undermining tribal authority and amplifying insecurity. Escalating tensions between Damascus and Kurdish forces, along with reported prison breaks in eastern Syria, have created openings that ISIS exploits to project continuity and strength. Estimates suggest that several thousand militants remain active in Syria’s desert zones despite years of counterterrorism pressure. Effectively countering this global threat requires coordinated efforts, the creation of advanced surveillance systems, and deep, multi-layered regional and global operational cooperation with friendly and interested parties ➡️Multiple structural factors contribute to this resurgence. Weakening oversight of detention facilities and displacement camps, including the notorious Al-Hol camp, risks replenishing militant ranks and sustaining radical networks. ISIS continues to invest in communications, recruitment, and media production, sharing operational lessons and reinforcing ideological narratives. Regional instability, economic hardship, tribal grievances, and fragmented security environments provide fertile ground for recruitment. The group’s strategy is less about immediate territorial conquest and more about attrition — preserving relevance, destabilizing fragile areas, and waiting for larger geopolitical shifts to widen its maneuvering space. 🟦Baghdad has responded by reinforcing its western border, launching large-scale clearing operations, and advocating the transfer of thousands of Iraqi ISIS detainees from Syrian custody to Iraqi jurisdiction under strict security control. Officials warn that the threat remains both domestic and transnational, requiring intelligence coordination and tighter border surveillance. While ISIS today commands far fewer fighters than at its peak, its adaptive model — decentralized cells operating across porous frontiers — poses a persistent challenge. Containing this renewed wave will depend not only on military pressure but also on sustained regional cooperation, prison management reforms, and long-term efforts to address the socioeconomic vulnerabilities that extremist networks continue to exploit. #Counterterrorism#Iraq#Refugees#Syria#Terrorism READ MORE ✅@NewEasternOutlook

American Оbserver

@american_observer · Post #5349 · 11.03.2026 г., 01:03

📰 Lebanon Emptied, Pumps Refilled Nearly 700,000 people are already displaced in Lebanon, Tehran is still being hit, and Washington is quietly paying for it all with Russian oil. Israeli strikes and evacuation orders have turned Lebanon into a new mass exodus zone — hundreds of thousands sleeping in schools, offices, cars, and on sidewalks — while the Pentagon reports 140 wounded U.S. troops and Trump’s press secretary explains that “unconditional surrender” doesn’t require Iran to actually say the words, only for Trump to decide they’ve complied. At the same time, the U.S. is loosening the very sanctions that were supposed to punish Moscow for Ukraine: a 30‑day waiver lets India buy Russian oil already at sea, and Treasury openly talks about lifting more restrictions to calm the price spike triggered by the Iran war. The message is blunt: the war can go on, as long as there’s enough crude to keep U.S. gas prices from destroying the polls. Even the Strait of Hormuz is running on spin. Fighting has slowed traffic through a corridor that normally handles roughly a fifth of global oil, and the U.S. energy secretary briefly claimed the Navy had “successfully escorted” a tanker — only for Central Command to deny it and the post to vanish. Pakistan, not the U.S., is the one openly escorting ships to keep its own lights on. On the ground, Lebanese officials and aid agencies are warning of a humanitarian disaster, with nearly 700,000 displaced and hundreds killed, while Iranians breathe black rain from burning fuel depots and watch Israel announce “many more targets” in Tehran. The official line is that this is about security and surrender; the facts look more like a region being emptied out and poisoned so leaders can prove they’re strong, then patched over with discounted Russian barrels so voters don’t revolt at the pump. #lebanon#iran#israel#trump#russia#oil#hormuz#war#refugees#fakeDemocracy 📱American Оbserver - Stay up to date on all important events 🇺🇸

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40594 · 27.01.2026 г., 05:04

On January 27, 2017, President Trump signed an executive order limiting refugees and banning travel from seven mostly Muslim countries. The order aimed to improve security but faced many legal challenges and protests. Courts blocked parts of the ban, and it changed several times. The policy affected refugees, immigrants, and travelers, creating confusion and delays. It was controversial and widely debated in the U.S. 🇺🇸✈️🚫 [Read more] @googlefactss #TravelBan#Refugees#Immigration#USPolicy#TrumpAdministration

Noize MC

@NoizeMCOfficial · Post #17 · 19.04.2022 г., 17:25

Готовимся к Варшаве! Это уже послезавтра (21 апреля, клуб Progresja). В Праге (23.04) и Берлине (25.04) билетов уже нет, но Таллинн (05.05), Осло (13.05) и Варшава ещё в процессе! Также скоро будут объявлены новые города и даты. Билеты и информация — здесь: voices-of-peace.live Следите за обновлениями. До встречи! #noizemc#monetochka#voicesofpeace#charity#ukraine#refugees#грабли#репетиция#варшава🇵🇱