@fight4f · Post #8275 · 06.05.2024 г., 13:03
荷蘭的英文版每日更新 https://ig.me/j/AbZXhCHKgod1rjEq/ #engels
Hashtags
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
Пребарај: #engels
@fight4f · Post #8275 · 06.05.2024 г., 13:03
荷蘭的英文版每日更新 https://ig.me/j/AbZXhCHKgod1rjEq/ #engels
Hashtags
@druschbaFm_en · Post #52330 · 20.03.2025 г., 08:04
⚡️ 🇷🇺 🇺🇦⚔️ Ukraine Fronts on the Morning of 20 March⚡️ 🔴#Sumy Direction: 🔴In #Sudzha Sector, in the west, fighting continues in and near #Zhuravka, as well as southeast of it in #Basovka on Ukrainian territory. 🟡 In #Kursk region, fierce battles in the areas of the #Gogolevka and #Guyevo villages continue. 📌 Referring to Previous Reports, doubts have arisen as to whether fights are already taking place in the villages. There is still no objective control footage. We have corrected our arrows on map accordingly, which show the control and mentioned locations. 🟡#Oleshnya and #Gornal remain safe under AFU control. 🔴 In #KrasnayaYaruga Sector, south of #Sudhza in Russian #Belgorod region, further massive AFU assaults especially on #Demidovka, as well as in the areas of #Grafovka and #Prilesye have been foiled. The search for the remnants is ongoing. 🗺 All on Map 1 ✈️An AFU F16 was downed. 📌 The AFU Command is reportedly reinforcing all areas and intends to continue also the attacks on #Belgorod region. 🔴 In #Kharkov Direction, without significant changes. 🔴#Svatovo Front: 🔴 In #Kupyansk Sector, fierce fighting along the LoC continues, but without changes. 🔴 In #Borovaya Sector, the battle for #Boguslavka continues. 🔴In #Liman Sector, the RFAF advanced west of the #BalkaZhuravka settlement. 🔴In #Seversk Sector, fights in the area of #Bologorovka (#LPR) and in #Verkhnekamenskoye continue. 🔴#ChasovYar Direction: 🔴In #ChasovYar Sector, the northwestern part of the city is almost completely under Russian control. The battle for the centre southwest of the 'Refractory Plant' continues. Russian troops attacked from the east with armoured vehicles. The result of the battle is disputed. 🗺 Map 2 🎬 Video 1 🔴In #Toretsk Sector, northeast of the city, RFAF units attacked northeast of the #Druzhba settlement towards positions taken by Russian assaults beyond the canal near #Ozeryanovka. 🟡 In #Toretsk itself, the RFAF expanded their zone of control. 🔴#Pokrovsk Direction: 🔴 On the right Flank and south of the city, without significant changes. 🔴 On the left Flank, the battle for #Udachnoye continues as usual. 🟡 In #Uspenovka, the fierce battle continues and towards #Novoalexandrovka southwest of it. 🟡 In #Preobrazhenka, fighting for the eastern settlement part continues. To the south, the Russian troops are attacking towards #Troitskoye and #Bogdanovka. 🔴#Komar Direction: 🔴In #Konstantinopol Sector, the RFAF advanced west of #Slavyanka and north of #Andreyevka, but were driven out of a stronghold northwest of the latter. 🟡 In #Konstantinopol, the battle continues. 🔴 In #Komar Sector, the yesterday reported Russian advance south of #Privolnoye has been confirmed, the fights for the village itself continue. 🔴#Zaporozhye Direction: 🔴In the #Orekhov Section, north of #Rabotino the RFAF attack towards #Novodanilovka and further west in the direction of #Novoandreyevka. 🟡 For #Shcherbaki and #MalyeShcherbaki, the battle continues. 🟡#Stepovoye came, according to unconfirmed reports, under Russian control, as well as heights north of it. 🟡 For #Lobkovoye, the battle has begun with fights in the village (unconfirmed), alternate on its approaches. 🔴 In #Kherson Direction, without significant changes. 💥#OldRussia: 🔵In #Voronezh Region, ca. 40 AFU UAVs were downed overnight. In the #Saratov region, Zelensky tried to raid the Oil Refinery in #Engels, as a result of which the 'City Clinical Hospital No. 1' has been damaged. In the #Rostov region, another UAV attack was repelled. In #Gorlovka (#DPR), 11 civilians were wounded yesterday by Zelensky's morning shelling of the city centre. 💥#RestUkraine: 🔵 In #Kirovograd Region, in turn, after a massive Geranium UAV attack, more than 30 explosions occurred in the town of #Kropyvnytsky. 🎬 Video 2 🎞 Vids Source 1; Source 2; 🗺 Maps @olegtsarov; @creamy_caprice 📋 Sources: CC; Tsarov; ⚡️2M; 🇺🇦Fiend; 😼Kotenok 🕰20 Mar 2025; 06:44 GMT+3; #smo 📱 Join GLOBAL DEPTH to boost your TG Feed 💬Welcome to Military Chat & Ukraine Observer
Hashtags