Что делать если нужно поставить какую-то 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
🎙️WEEK 16 | LIVE DISCUSSION
🔴FROM ADWA TO HARLEM
▪️How did Ethiopia’s 1896 victory under Menelik II inspire Black resistance in America?
▪️How did the 1935 Italian invasion spark mass mobilization in Harlem?
⚔️TOPICS:
▪️Fascism, Ethiopia & U.S. Neutrality
▪️Government measures against Black internationalists
▪️Ethiopia as a symbol of Black dignity & global solidarity
📅Feb 25, 2026
🕗 8–10 PM (EST) | 2–4 PM (Ethiopia)
🎙️Host: Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🔗Join Live:https://t.me/+AAE_Pc8aWTczYTA0
🔥 History. Power. Resistance.
Don’t miss this deep dive into Ethiopia and the global Black experience.
#Adwa#PanAfricanism#Ethiopia#BlackInternationalism#RedNileMedia#EthiopiaFirst
🎙️WEEK 9 | LIVE GEOPOLITICAL DISCUSSION
Who Defines Ethiopia?
State Formation, Violence & the Clash Between Aithiopology vs Ethiopology
🔹 Did Ethiopia lack legitimacy at its birth—or is it being judged through Western theories that were never meant for ancient civilizations?
🔹 This live discussion critically examines recent remarks by Ethiopia’s Foreign Minister, challenges the social contract myth, and explores Ethiopia’s state formation through its own historical and civilizational lens.
📅Jan. 02, 2026
🕕8:00–10:00 PM EST | ከምሽቱ 2:00–4:00
🎙️Host: ኢትዮጵያ ትቅደም | Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🎛️Moderator: Sheralin
📡Ethiopia First. Always.
🔴RedNile Media
👇Join ኢትዮጵያ ትቅደም Telegram Channel
https://t.me/+AAE_Pc8aWTczYTA0
#Ethiopia#Geopolitics#Ethiopology#Aithiopology#StateFormation#RedNileMedia#EthiopiaFirst
🎙️WEEK 9 | LIVE GEOPOLITICAL DISCUSSION
Who Defines Ethiopia?
State Formation, Violence & the Clash Between Aithiopology vs Ethiopology
🔹 Did Ethiopia lack legitimacy at its birth—or is it being judged through Western theories that were never meant for ancient civilizations?
🔹 This live discussion critically examines recent remarks by Ethiopia’s Foreign Minister, challenges the social contract myth, and explores Ethiopia’s state formation through its own historical and civilizational lens.
📅Dec 19, 2025
🕕8:00–10:00 PM EST | ከምሽቱ 2:00–4:00
🎙️Host: ኢትዮጵያ ትቅደም | Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🎛️Moderator: Sheralin
📡Ethiopia First. Always.
🔴RedNile Media
👇Join ኢትዮጵያ ትቅደም Telegram Channel
https://t.me/+AAE_Pc8aWTczYTA0
#Ethiopia#Geopolitics#Ethiopology#Aithiopology#StateFormation#RedNileMedia#EthiopiaFirst
🔺Continuation from above
@rednile12
🔷Ras Alula’s Warning — and Italy’s Defiance
Deeply angered by the occupation, Ras Alula Abanega, the most formidable general of Emperor Yohannes IV, sent a formal letter to the Italian commander General Genè, demanding that Italian forces vacate Ethiopian territory.
❗️ Italy refused.
General Genè responded that he had no authorization from Rome to withdraw, and instead advanced inland toward Saati, where Italian forces began building fortifications—a clear signal that Italy intended permanent occupation.
🔷The Battle
Ras Alula immediately mobilized his forces. Moving swiftly from the highlands, he confronted the Italian column at Dogali, a narrow and exposed terrain ideal for Ethiopian tactics.
🔹 Italian force: ~550 soldiers
🔹Ethiopian force: Larger, mobile, and battle-hardened
🔹Result:
▪️~470 Italian soldiers killed
▪️~80 wounded
▪️The Italian column was almost entirely annihilated
This was not a skirmish—it was a strategic humiliation.
🔷Shockwaves in Italy and the Western Press
🔹Italian Press Reaction
The defeat sent shockwaves through Italy.
▪️Newspapers such as La Tribuna and Corriere della Sera described Dogali as a “national tragedy”
▪️The fallen soldiers were quickly turned into martyrs of empire
▪️Public outrage fueled calls for revenge, not withdrawal
Instead of questioning colonial aggression, the Italian press framed the defeat as:
▪️ A stain on national honor
▪️ Proof that Italy needed more troops, more funding, and harsher measures
This reaction directly paved the way for Italy’s militarization of Eritrea and its later full-scale invasion of Ethiopia—culminating in Adwa (1896).
🔷Western Media Narrative
Much of the broader European press reacted with disbelief.
▪️ Ethiopia’s victory contradicted the racist colonial assumption that African armies could not defeat Europeans
▪️ Some Western outlets downplayed Ethiopian strategy and leadership, attributing the loss to:
▪Italian “mismanagement”
▪Poor logistics
▪Terrain
🔹 Rarely did they acknowledge:
▪️Ras Alula’s military brilliance
▪️Ethiopia’s organized command structure
▪️Indigenous intelligence and strategy
Yet privately, Dogali triggered a quiet realization in Europe:
Ethiopia was not a weak state—it was a serious military power.
🔷Why Dogali Matters
Dogali was:
▪️One of the first major African victories over a modern European army
▪️A psychological blow to colonial arrogance
▪️A direct precursor to Adwa, where Italy would suffer an even greater defeat
▪️It proved that Ethiopian resistance was not accidental, but systematic, strategic, and national.
መብቱን ዮሐንስ ላሉላ ቢሰጠው
እንደ ቀትር እሳት ቱርክን ገላመጠው
ጣሊያንም ወደቀ እያንቀጠቀጠው
አጭዶና ከምሮ እንደገብስ አሰጣው።»
Photo Descriptions
Image 1: Ras Alula Abanega, architect of the victory at Dogali
Image 2: Italian troops burying their dead after the defeat (January–February 1887)
Image 3: Wounded Italian soldiers transported back to Italy and treated in Naples
— RedNile Media🌊🧭
📡@rednile12
Geopolitics | Multipolarity | Sovereignty | Strategic Reality
#RedNileMedia#EthiopiaFirst
#BattleOfDogali#AdwaVictory
#FromDogaliToAdwa
#HistoryBeyondTheWest
The Strategic Containment of an Empire: How Europe Engineered Ethiopia's Landlocked Fate
Red Nile Media | Deep Dive Analysis
The story of Ethiopia in the late 19th and early 20th centuries is often celebrated as a heroic narrative of military triumphs at #Dogali (1887) and #Adwa (1896). Yet, a closer examination reveals a far more complex geopolitical saga. These victories did not translate into unbridled sovereignty; rather, they triggered a deliberate and coordinated European strategy of containment. The culmination of this strategy was the 1906 Tripartite Treaty—a formal pact that sealed Ethiopia’s landlocked destiny.
📌 This article expands on that history, incorporating academic perspectives to illuminate the “how” and “why” behind this enduring geopolitical outcome.
🔗Read the Full Article Here
#RedNileMedia#EthiopiaFirst
#BattleOfDogali#AdwaVictory
#FromDogaliToAdwa
#HistoryBeyondTheWest
🎙️WEEK 17 | LIVE DISCUSSION
⚔🛡My Generation & Adwa
Reflecting on the 130th Anniversary of the Victory of Adwa
In honor of the 130th Anniversary of the Victory of Adwa, celebrated on Yekatit 23, 2018 (E.C.), we invite you to a powerful and timely conversation on legacy, identity, and national consciousness.
Tonight, on the Ethiopia First Telegram Channel, we will discuss, reflect, and critically engage on what Adwa means for our generation — and why it still matters today.
Be part of this historic dialogue.
📅February 27, 2026
🕗8:00–10:00 PM (EST) | 2:00–4:00 PM (Ethiopia Time)
🎙️Host: Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🔗Join Live:https://t.me/+AAE_Pc8aWTczYTA0
—
#Adwa130#VictoryOfAdwa#AdwaAnniversary#MyGenerationAndAdwa
#EthiopiaFirst#RedNileMedia#EthiopianHistory#AfricanVictory
#PanAfricanLegacy#Yekatit23#EthiopianPride#AdwaSpirit#EthiopiaRising