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

Резултати

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

Пребарај: #ifj

当前筛选 #ifj清除筛选
Russian MFA 🇷🇺

@MFARUSSIA · Post #28861 · 25.03.2026 г., 12:48

#MartyrsForTruth ⚡️The Russian Union of Journalists has published a report – Inconsistencies in the Public Accounting of Killed Journalists in 2025:: A Comparative Analysis of CPJ, UNESCO and IFJ Materials. 📄 FULL REPORT (PDF/ Telegraph) ❗️ The report is based on open sources and addresses a fundamental question: why do some cases of journalists being killed receive full international visibility, while others – despite being publicly recorded by international organisations such as #UNESCO, the International Federation of Journalists (#IFJ), and a number of international bodies – are effectively omitted from the statistics? The analysis reveals inconsistencies between the Committee to Protect Journalists' (#CPJ) public reporting for 2025 and a number of cases involving Russian journalists whose deaths were recognized by other international bodies. 👉This raises questions not only about the integrity of the record, but about the credibility of the entire international system for documenting journalists’ deaths. The analysis was prompted by the observed discrepancy between the CPJ’s overall reporting on Ukraine for 2025 and a number of cases involving Russian journalists and media workers, whose deaths were recorded and commented on by other international organisations. More specifically, on February 25, 2026, the CPJ reported that 129 journalists and media workers were killed worldwide in 2025 – the highest figure in the organisation’s history. In the same review, the CPJ stated that four journalists were killed in Ukraine in 2025. The organisation’s public materials lists a number of Ukrainian journalists and French photojournalist Anthony Lallican among those cases. ❗️ At the same time, several cases involving Russian journalists and media workers killed in 2025 do not appear in the CPJ’s open-source materials, despite public statements by the IFJ and UNESCO, and, in a number of instances, reporting by Reuters. They include: ▪️Alexander Martemyanov ▪️Alexander Fedorchak ▪️ Alexander Sirkeli ▪️Andrey Panov ▪️Anna Prokofyeva ▪️Ivan Zuev 👉 The key question is not about disputing the figures or removing names already included in international lists. It is whether all comparable cases are being recorded publicly, consistently, and by the same standards. That is why the focus of professional discussion should not be the slogan of “double standards” as such, but the specific gap between the CPJ’s published methodology and what can be observed in its public reporting on a number of 2025 cases. When that consistency is missing – or left unexplained – it raises questions not just about one report, but about the credibility of the entire international system for documenting threats to journalists.

Marx21.it

@marx21news · Post #10186 · 16.04.2026 г., 06:45

🗞️ “Informare non è solo un mestiere. È una condizione della democrazia.” A pochi giorni dal Congresso Mondiale della Federazione Internazionale dei Giornalisti (IFJ) a Parigi, pubblichiamo un'intervista al segretario generale Anthony Bellanger. Un secolo di lotte, dal 1926 a oggi, per l'indipendenza e la dignità della professione. Dai regimi autoritari degli anni '30 ai conflitti odierni in Ucraina, Gaza e Sudan, la posta è sempre la stessa: resistere alla censura, alla precarietà e alla violenza. Oggi i giornalisti sono bersaglio. Più di 3.000 uccisi in 35 anni. Non solo in guerra, ma per aver indagato su corruzione e abusi di potere. La IFJ chiede una Convenzione ONU vincolante per proteggere chi informa. In un mondo di disinformazione e giganti tecnologici, l’etica e la solidarietà internazionale restano le nostre bussole. 👉 Leggi l'intervista completa e scopri le sfide del prossimo congresso https://www.marx21.it/internazionale/giornalismo-etica-e-dignita-una-lotta-secolare/ #Giornalismo#LibertàDiStampa#Etica#IFJ#Democrazia#DirittiUmani

Addis Standard

@addisstandardeng · Post #21662 · 10.03.2026 г., 07:37

News: IFJ condemns killing of journalist in #Kismayo, calls for urgent investigation The International Federation of Journalists (#IFJ) has condemned the killing of #Somali freelance journalist Abshir Khalif Shide Omar, who was shot dead by a police officer in the city of Kismayo in southern #Somalia. According to the IFJ, Omar was killed on 2 March following a brief altercation with a police officer in Kismayo, the commercial capital of the autonomous #Jubbaland region, located about 528 kilometers from #Mogadishu. The IFJ said it joined its affiliate, the National Union of Somali Journalists (#NUSOJ), in condemning the killing and calling for an urgent and thorough investigation into the incident. In a statement, NUSOJ said Omar had been returning from an Iftar gathering with colleagues after editing a program about politicians that was scheduled to be released later that ..... https://web.facebook.com/AddisstandardEng/posts/pfbid0CUPBLiJrwHBnxuTeaq4c3XBuwGLUFaJBRrEfKh76fYSRWke8MXX2wcfBmkJVDJsal