Что делать если нужно поставить какую-то 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
News: #Amhara security bureau alleges #TPLF, #Eritrea involvement in ongoing conflicts
The Amhara Regional State Peace and Security Bureau has alleged that ongoing conflicts in the Amhara region and elsewhere in #Ethiopia are receiving what it described as “leadership and logistical support from #Mekelle and #Asmara,” referring to the Tigray People’s Liberation Front (TPLF) and Eritrean government.
In a statement released yesterday, the bureau said the public “must understand the reality” that the fighting is not only against groups it characterized as “extremists” but also involves what it described as internal and external actors.
The statement further alleged that a group seeking control over the areas of #Wolkait, #Telemt, and #Raya had assigned what it called a mission to “internal extremist forces” and was mobilizing them to advance that objective.
According to the bureau, the strategy aims to create conflicts across various zones and districts to...
Read more: https://addisstandard.com/?p=55148
📝ANALYSIS: The Unmasking of Addis Standard: Independence or Illusion?
✍🏽By Dhuga Bilisuma | Red Nile Contributor
📅 February 16, 2026
In a detailed piece for RedNile, contributor Dhuga Bilisuma subjects Addis Standard’s recent coverage to rigorous academic scrutiny, questioning whether the outlet’s self-proclaimed “independence” withstands analytical review.
Drawing from established media theory — including the framing work of Robert Entman and agenda-setting theory — the article examines three editorial patterns from January–February 2026 that raise concerns about conflict-sensitive reporting standards in Ethiopia’s fragile post-conflict environment.
1️⃣ Territorial Framing: “Wolkait” vs. “Western Tigray”
When Prime Minister Abiy Ahmed referred to “Wolkait” during parliamentary remarks, Addis Standard’s headline substituted the term with “Western Tigray.”
📌The Critique:
Framing theory suggests such terminology shifts are not neutral. In a contested territorial dispute, choosing nomenclature different from the speaker’s own wording can signal narrative alignment — especially when competing historical and constitutional claims are involved. The report, according to Bilisuma, lacked the contextual clarification recommended by conflict-sensitive journalism standards.
2️⃣ Agenda-Setting: Selective Visibility of Protests
In late January, demonstrations reportedly took place in #Telemt, #Humera, #Wofla, #Korem, #Zata, #Dabat, #Debark, and #Dejach_Meda, with protesters calling for full implementation of the 2022 Pretoria Peace Agreement.
#AddisStandard reportedly provided no coverage of these protests.
📌The Critique:
Agenda-setting theory argues that what media omits can be as influential as what it highlights. For diaspora readers — who rely heavily on English-language reporting — such omissions may shape international perception by rendering certain grievances invisible in global discourse.
3️⃣ Post-Publication Revision: The “Maneuver” Case
In reporting remarks from the Tigray Interim Administration, the outlet initially used the military term “maneuvering” to describe troop movements.
📌The Critique:
While revisions are common in journalism, Bilisuma points to a pattern of reactive, non-transparent language adjustments. In a post-conflict setting governed by the Pretoria Agreement, terms like “maneuver,” “movement,” or “deployment” carry significant implications regarding compliance or breach.
Inconsistent transparency in edits can undermine public trust.
4️⃣ The Broader Pattern: Asymmetrical Context
The article argues that detailed historical grievances and counter-arguments are frequently added when framing federal officials. However, similar contextual depth is not consistently applied when reporting on actors associated with #TPLF leadership.
📌The Critique:
This uneven distribution of contextual scrutiny may generate cumulative narrative asymmetry — shaping reader perception without explicit editorial positioning.
🧭 The Verdict
Bilisuma stops short of alleging intentional bias. Instead, he argues that the cumulative effect of terminology choices, selective coverage, and revision practices constructs a particular political terrain for readers.
For diaspora audiences — whose understanding of events often depends on outlets like #AddisStandard — these framing dynamics carry amplified consequences.
“Media independence is not established solely through mission statements. It is demonstrated through transparent editorial standards.”
♦️Bottom Line: A must-read for anyone who consumes Ethiopian media critically. In fragile post-conflict societies, framing is never just semantics — it is politics.
📌Read the full article here:
The Unmasking of Addis Standard: Independence or Illusion?
#Ethiopia#MediaAnalysis#AddisStandard#RedNile#ConflictReporting#Framing