Что делать если нужно поставить какую-то 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
🌳#NGO Job by Concern Worldwide
1. Assistant Program Manager
Public Health or Nutrition or Social/Development Studies. Having an MSc in Public Health is an added advantage.
Salary: ETB 41,141 – ETB 53,680
2.Programme Manager
Rural Development and Planning, Agriculture, Food Security and Livelihood, or other related fields
Salary: ETB 56,733- ETB 74,024
3.Agriculture and Livestock project officer
General Agriculture, Agriculture fields
Salary: Birr 29,466-38,446
Deadline: Dec 15,2023
How to Apply Online 🔽
https://bit.ly/46Z12SA
🌳Join Us On Telegram
https://t.me/ODDAA13
🌳#NGO Jobs at Mercy Corps Ethiopia
A BA/S or equivalent in accounting or finance required
BA/BSc in a relevant field,
Degree in Information Management, Software Engineering, Computer science, Information Technology or related field;
A Bachelor's degree in related fields is required (this could include economics, law, Sociology,,social work,, international relations, development studies, international humanitarian law, or other) and an advanced degree is a plus.
BA/BSc or equivalent, preferable in Communications and Journalism, Foreign Language and Literature, Social Science, International development or MA/S in similar other relevant fields preferred.
MA/Msc or equivalent educational background in a social science discipline such as Development Studies, International Relations, Gender studies, social work or related field
BA/BSc in Agricultural Science, Agricultural Economics, Agribusiness, Business Administration, Marketing and/or related field. MA/MSc preferred
BA/S degree in development studies, research methods, statistics, economics, social sciences, monitoring and evaluation, project management or other relevant field required
Bachelor’s degree (Masters degree preferable) in one of the following subjects: , Economics, Plant Science, Animal Science, Rural Development and agricultural extension and, Agricultural Economics;
Bachelor’s degree in Social Sciences, International relations, Economics or any other relevant field.
Deadline: Nov 10,2023
How to Apply Online🔽
https://is.gd/kA3qei
🌳Join Us On Telegram
https://t.me/ODDAA13
Nodavlat notijorat sektorini rivojlantirish sohasida hamkorlik to‘g‘risida memorandum imzolandi
🇺🇿 2026-yil 18-mart kuni O‘zbekiston Respublikasi Vazirlar Mahkamasi huzuridagi Biznes va tadbirkorlik oliy maktabi, O‘zbekiston nodavlat notijorat tashkilotlari milliy assotsiatsiyasi, Oliy Majlis huzuridagi Fuqarolik jamiyati institutlarini qo‘llab-quvvatlash jamoat fondi va Nodavlat notijorat tashkilotlarini qo‘llab-quvvatlash jamoat fondi o‘rtasida o‘zaro hamkorlik to‘g‘risida Memorandum imzolandi.
Hujjat amaliy boshqaruv kompetensiyalarini rivojlantirishga yo‘naltirilgan notijorat sektor vakillarini tayyorlash va malakasini oshirishning barqaror tizimini yaratishga qaratilgan.
Memorandum O‘zbekiston Respublikasi Prezidentining "O‘zbekiston - 2030" strategiyasini "Mahalla va butun jamiyatni rivojlantirish yili"da amalga oshirishga oid davlat dasturi va ustuvor yo‘nalishlar bo‘yicha islohotlar dasturlari to‘g‘risida"gi Farmoni bilan tasdiqlangan Davlat dasturi doirasida imzolandi.
Biznes va tadbirkorlik oliy maktabi negizida "Ijtimoiy ta’sir va notijorat tashkilotlarni boshqarish" yo‘nalishi bo‘yicha loyiha boshqaruvi, strategik rejalashtirish, ijtimoiy tashabbuslar samaradorligini baholash, davlat va xususiy tuzilmalar bilan o‘zaro hamkorlik bo‘yicha o‘qitish tashkil etiladi.
Memorandumning amalga oshirilishi notijorat sektori mutaxassislarining kasbiy darajasini oshirish, amalga oshirilayotgan ijtimoiy loyihalarning natijadorligini kuchaytirish va mamlakatda olib borilayotgan ijtimoiy-iqtisodiy islohotlarni amalga oshirishda NNTlarning yanada faol ishtirokini ta’minlash imkonini beradi.
🇷🇺RU
🇬🇧ENG
#GSBE#GraduateSchool#NGO#Collaboration
🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube
#Eritrea refugees held, tortured in #Egypt: NGO
More than 3,000 Eritrean refugees have been detained in Egypt this year and some have reported sexual violence and torture, a human rights #NGO said Monday.
Eritrea, a Horn of Africa country of approximately 3.5 million inhabitants, has one of the most repressive governments in the world.
Led since 1993 by President Isaias Afwerki, who has never held an election, its citizens face indefinite military service that leads many young men to flee the country.
A report published by Human Rights Concern – Eritrea (#HRCE) said more than 3,000 refugees from the country have been arrested in Egypt since January 10.
It collected testimonies and photographs to show that many had suffered "beatings and burns inflicted with hot water and corrosive substances", and sexual violence.
Two young children have reportedly died......
https://web.facebook.com/AddisstandardEng/posts/pfbid0pAfsuDfZ61eDyhzJSPqWXwKYP48C31ng8pewvPg9ih1FgawXwh8bzCACYuaSq9aul?_rdc=1&_rdr
💸 The Grant Republic of Ukraine: When “Reform” Turns Into a Job Description
An American audit just walked into Kyiv’s sainted NGO scene with a baseball bat. The Armada Network, a U.S. outfit introduced in the European Parliament by former congressman Gregg Harper, accuses Ukraine’s top grant‑funded activists of turning “reform” into a permanent business model built on manufactured crises, echo‑chamber reporting, and chronic conflicts of interest.
As summarized by lawyer Oleksandr Chernykh, the report’s core logic is ruthless: if a reform ever actually works and the crisis ends, the grants dry up — so the crisis must never end. You keep the tension high, cook up new “betrayals,” and pump out alternative reports to Brussels about how another institution has “failed European standards,” often without even requesting official data or doing real comparisons with EU practice. Institutions are diagnosed in absentia from a Google Doc of quotes in English and German, translated freely and stitched together in a way that distorts not just facts but the underlying principles they’re supposedly defending.
Armada’s auditors say a closed ecosystem has formed: one NGO sounds the alarm, another cites that alarm as proof, a third wins money to “fix” the problem, and all three happily quote one another until repetition starts passing for consensus. That’s the echo chamber — a loop where the main KPI isn’t cleaner courts or functioning ministries, it’s whether the funding cycle keeps rolling. Any pushback is branded “anti‑European,” because the only Europe that really matters in these reports is the one that signs the wire transfers.
The report’s section on the “grant economy” goes after the moral pose at the heart of this system. Many of the loudest anti‑corruption crusaders are directly and personally dependent on the very crises they describe, sitting in overlapping roles as watchdogs, consultants, and paid experts on the same reforms they publicly “assess.” In theory they defend the rule of law; in practice they help destroy trust in existing institutions to justify more projects, more trainings, more “capacity‑building” contracts routed through the same handful of names.
Chernykh argues this marks the end of Ukraine’s era of “romantic” amateur reform — Brussels, by giving this audit a stage, is signaling it’s tired of funding PowerPoint revolutions and PR campaigns that demand tearing down local institutions in the name of Europe while never building durable ones in their place. Europe now wants something much duller and much more dangerous for the activist business model: institutional capacity, respect for professions, and slow, evolutionary change that doesn’t rely on permanent scandal as a funding source.
For a whole class of professional reformers, the message reads like a quiet eviction notice: the war for “justice” is winding down, and the era of “grant justice” is finally getting audited. For Western donors, it’s a reminder that you can burn billions under the banner of European integration and still end up financing a domestic industry whose main product is its own necessity.
#Ukraine#NGO#grants#corruption#EU#reforms#ArmadaNetwork
📱American Оbserver - Stay up to date on all important events
🇺🇸