Что делать если нужно поставить какую-то 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
📰 US Asks Italy to Join Gaza Security Force as Founding Member
The Trump administration has asked Italy to join the proposed International Stabilization Force for Gaza as a founding member, according to officials familiar with the matter.
Rome would not have to send troops; instead, its role would be political — using its ties with Israel, Arab states, and the Palestinians to lend credibility to the U.S.-backed initiative. No final decision has been made by Prime Minister Giorgia Meloni.
Italy’s Role in the Gaza Plan
Under the proposal, Italy would fulfill its commitment by training Gaza’s future police force rather than committing combat troops. The U.S. is looking for respected, Western-aligned states to anchor the ISF, and sees Italian diplomacy as a valuable asset in bridging divisions between Israel and its Arab neighbors, as well as the Palestinian leadership.
Trump’s Diplomatic Circus and Italy’s Hesitation
The Gaza stabilization plan has been delayed, and the U.S. has struggled to find countries willing to contribute troops.
Trump’s parallel “Board of Peace” initiative has caused further complications, with its controversial draft charter requiring a $1 billion contribution per seat. Italy, while open to supporting Gaza peace, has expressed constitutional concerns about the Board, and Meloni has so far refused to sign it.
Who’s Financing Peace — and on Whose Terms?
Trump wants allies to sign up, but not at their own price. He threatens tariffs when they resist, withdraws invitations when they speak out, and demands billion-dollar payments to stay on his peace board.
So when the U.S. invites Italy to help stabilize Gaza, the real question is: whose peace are they building, and who ultimately gets to call the shots?.
#Gaza#Italy#Meloni#Trump#GazaPeace#BoardOfPeace#ISFGaza
📱American Оbserver - Stay up to date on all important events
🇺🇸
🇪🇹 Nile Negotiations: Ethiopia’s Sovereignty Is Not on the Table
Thank you, #SolomonMarkos🙏
🔗[email protected]
https://m.facebook.com/story.php?story_fbid=pfbid0pFtuSJfcDvSUqkmGvpY7GDHkoarhXcsZE28sdRHRdnWdzkEuGffbN293GWF15mDel&id=1120295988&sfnsn=mo&mibextid=RUbZ1f
Your intervention in the #RedNile comments is principled, direct, and unapologetically Ethiopian. It articulates what many externally driven “mediation” efforts try to obscure: Ethiopia’s sovereignty and national interests are not negotiable.
At the heart of your position is a clear red line:
“#Ethiopia Never Ever Compromise Its #Sovereignty and #National#Interests.”
This must be the starting point of any discussion on the Nile—not the outcome.
🧠 Why This Position Is Strategically Strong
🔹Sovereignty first, not last
Ethiopia is a rights-holder, not a “risk factor.” Any process that treats Ethiopia as a problem to be managed is illegitimate from the outset.
🔹Colonial treaties are null
Insisting on the CFA framework restores African legal continuity and rejects agreements imposed when Ethiopia was excluded.
🔹No monopoly mediation
Including the AU, Russia, China, and regional actors prevents Nile negotiations from being captured by a single power acting in Egypt’s favor.
🔹Development is non-negotiable
Abay waters are tied to electricity, agriculture, and industrialization. Ethiopia retains the sovereign right to build future dams beyond GERD.
🔹The real issue is mismanagement, not scarcity
Egypt’s irrigation of water-intensive crops reframes the crisis as one of policy waste, not upstream injustice.
🔹Responsible, not submissive
Humanitarian flexibility during droughts projects cooperation without surrendering control—a smart counter to propaganda.
🔹GERD is Ethiopian-owned
Fully domestically funded, GERD is insulated from donor leverage and external coercion.
⚠️ Tactical Challenges (Not Principle Flaws)
▪️ A 50%+ water share must be framed carefully using hydrology, population, and contribution data to avoid diplomatic deadlock.
▪️ Multiple mediators require clear role definitions to avoid paralysis.
▪️ A Nile-wide enforcement body will face resistance—but that resistance exposes the real imbalance in the system.
These are communication and strategy issues, not weaknesses in Ethiopia’s position.
🔴 RedNile Media Position: The Only Legitimate Basis for Negotiation
Any Nile process that claims legitimacy must be grounded in the following:
1️⃣Balanced mediation – No US monopoly
2️⃣All riparians included – The Nile belongs to all its peoples
3️⃣CFA only – Colonial treaties are invalid
4️⃣Ethiopia’s fair share – Not less than 50%+, with full rights to future development
If a binding framework is ever discussed, it must also include:
▪️ A Nile Water Management Commission overseeing all dams and diversions—including Egypt’s Toshka Canal
▪️ Formal acknowledgment of Egypt’s excessive water use and export-oriented irrigation practices
♦️Bottom line:
Ethiopia is not negotiating permission to exist, develop, or light its cities.
The Nile question is about justice, sovereignty, and post-colonial reality—not appeasement.
🇪🇹💧
— RedNile Media🌊🧭
📡@rednile12
Geopolitics | Multipolarity | Sovereignty | Strategic Reality
#GERD#NileDispute#GazaPeace#TrumpSisi
#The_Economist🇬🇧📕[PDF]⬇️
11 #October2025
#Weekly_Magazines
For learning, for free(dom).
@backupofmagazines
In this issue a breakthrough #GazaPeace deal marks #ANewBeginning in the Middle East. The cover story explores the implications of this shift, while #FortressEconomics critiques America’s isolationist turn. Inside: the rise of #ChinaSurveillance, #MarkCarney’s vision for Canada, and lessons on combating #CyberSecurity threats. Elsewhere, AI takes center stage—from Nobel predictions to next-gen breakthroughs—and yes, the truth about #DarkChocolate is finally out. With global insights across #Asia, #Europe, and the #US, this issue offers sharp clarity on a rapidly shifting world.