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

Резултати

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

Пребарај: #topoli

当前筛选 #topoli清除筛选
DruschbaFM - English

@druschbaFm_en · Post #52476 · 24.03.2025 г., 08:03

⚡️ 🇷🇺 🇺🇦⚔️ Ukraine Fronts on the Morning of 24 March⚡️ 🔴#Sumy Direction: 🔴In #Sudzha Sector, west of the embattled #Zhuravka on Ukrainian lands, the RFAF entered the northern outskirts of #Vladimirovka (or came close to; another black arrow on map). 🟡 In #Zhuravka, the battle continues. 🟡 In #Basovka, the RFAF advanced in its southern part. 🟡 At #Novenkoye, the RFAF advanced (1st red arrow). 🟡 In #Kursk region, the situation remained unchanged. #Rubanshchina remains Russian controlled (2nd red arrow), #Gogolevka, #Oleshnya, #Guyevo and #Gornal remain under AFU control for now (4 large blue arrows on map). 🟡 In #Melovoy, the battle continues (small black arrow). 🔴 In #KrasnayaYaruga Sector, the AFU continued to attack and could enter #Demidovka and gain a foothold in the ruined village's southern part. This morning, the battle for it and the adjacent forest plantations continues (red arrow turned to black). 🟡#Grafovka, remains under RFAF control. 🟡#Prilesye as well. 🗺 All on Map 1 📌Given the Events, the 1st AFU's minor interim result at high costs is of no strategic value whatsoever. On the contrary, the overall situation of the AFU has even worsened with the further aforementioned border crossing. 🔴#Kharkov Direction: 🔴In #Liptsy Section, positional battles are taking place. The frontline remained unchanged. 🔴 In #Volchansk Section, the same situation. 🔴#Svatovo Front: 🔴 In #Kupyansk Sector, Russian troops advanced in the eastern and western settlement parts of #Topoli and expanded the bridgehead towards the settlement of #Kamenka from the east. 🟡 In #Dvurechnaya, Russian infantry units advanced within the settlement boundaries. 🔴 In #Borovaya Sector, the AFU retook the settlement of #Nadiya and advanced in its area. 🎬 Video 1 🔴In #Liman Sector, without significant changes. 🔴In #Seversk Sector, as well. 🔴#ChasovYar Direction: 🔴In #ChasovYar Sector, there are reportedly fights in the city's southern 'Shevchenko Microdistrict,' and further south towards #Stupochki village. 🔴In #Toretsk Sector, fighting continues in the northern, central and southern parts of the city. 🔴#Pokrovsk Direction: 🔴 On the right Flank, the RFAF have entered the village of #Vodyanoye2nd west of #Tarasovka. 🗺 Map 2 🎬 Video 2 🔴 South of the City, the heavy fighting continued without any noteworthy results. 🔴 On the left Flank, there are ongoing heavy battles also without any tangible results. 🔴#Komar Direction: 🔴In #Konstantinopol Sector, fighting in and around the village of the same name and throughout the sector is ongoing. 🔴 In #Komar Sector, the battles continued without major changes. 🔴#Zaporozhye Direction: 🔴In the #Orekhov Section, fighting continues in #MalyeShcherbaki, to which Russian troops broke through several days ago and to the west near #Stepovoye. 🔴 In #Kherson Direction, the AFU have still presence in the area of ​​the 'Antonovsky Bridge,' where the RFAF disrupted another AFU rotation. Otherwise Russian artillery and Aerospace Forces are hitting AFU positions and facilities. 💥#OldRussia: 🔵 In #Rostov Region, Russian air defence repelled a massive AFU drone attack on several districts, as well as in #Novoshakhtinsk and on the approach to Rostov at night. In one of the #Voronezh region districts, more than five UAVs were destroyed. In the evening, the RF MoD reported dozens of destroyed drones in the #Crimea, #Belgorod, #Bryansk and #Kursk regions. In #Zaporozhye region, the AFU targeted an ambulance, killing a paramedic. In Pologi district the AFU disrupted the power supply. In the #DPR, 7 civilians were wounded by AFU strikes. ⚠️ This Report contains new info received after the usual 2-Majors morning report. 🎞 Vids Source 1; Source 2; 🗺 Maps @olegtsarov; @creamy_caprice 📋 Sources: CC; Tsarov; ⚡️2M; 🇺🇦Fiend;😼Kotenok 🕰As of 24 Mar 2025; 07:39 GMT+3;📃22 Mar 📱 Join GLOBAL DEPTH to boost your TG Feed 💬Join Military Chat for Comments & Discussions 🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update

DruschbaFM - English

@druschbaFm_en · Post #52278 · 19.03.2025 г., 08:04

⚡️ 🇷🇺 🇺🇦⚔️ Ukraine Fronts on the Morning of 19 March⚡️ 🔴#Sumy Direction: 🔴In #Sudzha Sector, to the west in #Ukraine, fights in and around #Zhuravka. To the southeast... 🟡 In #Basovka, the RFAF have advanced and the battle has shifted to the southern settlement part. 🟡 In #Kursk region, the battles for the villages of #Gogolevka and #Guyevo continue. 🟡#Oleshnya and #Gornal remain under AFU control. 🗺 Map 1; added arrows show the mentioned locations, black contested 🔴 In #KrasnayaYaruga Sector, the AFU crossed the border in the area of ​​the #Demidovka, #Grafovka and #Prilesye villages south of #Sudhza in #Belgorod region. Several attack waves have been stopped by destroying armoured vehicles. The AFU remnants tried to get a foothold. Fights on Russian territory, especially towards #Demidovka with tank support continued. According to the latest unconfirmed report, the invaders have withdrawn to their initial positions in #Sumy region. 🎬 Video 1 🗺 Map 2 🔴#Kharkov Direction: 🔴In #Liptsy Section, the AFU counterattacked unsuccessfully in the settlement area of #​​Glubokoye. 🔴 In #Volchansk Section, the battle for the city continues. 🔴#Svatovo Front: 🔴 In #Kupyansk Sector, to the north, the RFAF are advancing from #Topoli southwestwards towards #Kamenka, the eastern approaches of which are also attacked. Furthermore Russian troops advance from the south on the village. 🟡 Near #Krasnoye1st(Pervoye), to the southwest, Russin units are advancing on the settlement. 🟡#Figolevka, located further southwest, has been recaptured by the AFU. 🟡 North of #Kupyansk, Russian units are expanding the bridgehead northeast of #Kondrashovka. 🟡 Northeast of #Kupyansk, the AFU counterattacks in the area of #Petropavlovka. 🔴 In #Borovaya Sector, fierce fighting in the northern outskirts of #Boguslavka continues. 🔴In #Liman Sector, Russian troops have advanced to #BalkaZhuravka's northern settlement outskirts and continue to attack in the westerly direction. 🟡 North of #Torskoye, positional battles are taking place. 🔴In #Seversk Sector, fights in the area of #Bologorofka (#LPR) continue. The AFU still hold positions on the Chalk Quarry (White Mountain) south of the village. 🟡 In #Verkhnekamenskoye, fights for the centre. 🔴#ChasovYar Direction: 🔴In #ChasovYar Sector, fierce battles continue. The AFU counterattacks. 🔴In #Toretsk Sector, the situation is unchanged. 🔴#Pokrovsk Direction: 🔴 South of the City, heavy battles and counterattacks continue. The situation is dynamic. 🟡#Shevchenko has been recaptured by Russian forces. The AFU counterattacks. 🟡 In #Peschanoye, the same situation as for #Shevchenko. 🟡 In #Kotlino, the northwestern outskirts and the cemetery area are embattled. 🔴 On the left Flank, the battle for #Udachnoye continues. 🔴#Komar Direction: 🔴In #Konstantinopol Sector, west of #Andreyevka, the AFU have pushed back Russian assault groups, which attacked towards #Alekseyevka. 🟡 In #Konstantinopol, the RFAF lost control over the village. The AFU have advanced into its centre. 🎬 Video 2 🟡 South of #Konstantinopol, the RFAF expanded their control zone by more than 1 km. The battle for the village continues. 🟡 From #Razdolnoye, Russian units advanced northwards towards #Razliv and #Bogatyr. 🔴 In #Komar Sector, northwest of #VelikayaNovosyolka, the RFAF are building on their success at #Burlatskoye. 🔴#Zaporozhye Direction: 🔴In the #Orekhov Section, we have to clarify that according to objective evidence data, #Shcherbaki, #MalyeShcherbaki and #Stepovoye are still contested. 🔴 In #Kherson Direction, no changes. 💥#OldRussia: 🔵 In #Krasnodar Territory, the AFU struck the 'Kavkazskaya Oil Transshipment Point.' This, after the Trump - Putin call. 🎞 Video 1 Source; 🎞 Video 2 Source 🗺 Maps @olegtsarov 📋 Sources: CC; Tsarov; ⚡️2M; 🇺🇦Fiend; 😼Kotenok 🕰19 Mar 2025; 06:43 GMT+3; #smo 📱 Join GLOBAL DEPTH to boost your TG Feed 💬Welcome to Military Chat & Ukraine Observer 🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update