Что делать если нужно поставить какую-то 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
🌍 Earth Day x Tkong | Walking with the Earth
We believe that every action should be rooted in respect for nature.
Tkong is deeply committed to our shared home—Earth.
🌀 The image seen here reflects the natural elements within the Tkong logo—oceans, forests, and mountains, all part of our planet.
#EarthDay2025#Tkong#EnvironmentalProtection#EarthDay#WalkingWithTheEarth
⚠️ AIR POLLUTION IS A SERIOUS CONCERN!
In Quvasoy city, Do‘stlik residential area, the 82-KMK reinforced concrete products manufacturing plant is releasing toxic gases and other harmful substances into the atmosphere on a daily basis.
This situation poses a real threat to public health and the environment. Under the current circumstances, a legitimate question arises:
❓ How lawful and acceptable is such activity today?
We, as members of the public, respectfully but firmly request:
🔹 a thorough investigation of these emissions,
🔹 verification of whether the enterprise operates in full compliance with environmental and sanitary legislation,
🔹 and the adoption of appropriate measures if violations are identified.
🟢 Clean air is not a privilege — it is a fundamental right of every citizen.
🟢 Public health must take precedence over industrial interests.
Responsible authorities should not remain indifferent.
The public will continue to monitor this situation closely.
#AirPollution
#Quvasoy
#Dostlik
#Environment
#PublicHealth
#EnvironmentalProtection☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot
Instagram | Facebook | Twitter | Sayt | Youtube.
Central Asian Ecologists and Eco-Activists Forum at Green University
🔴On April 8, 2026, Green University hosted the Central Asian Forum of Ecologists and Eco-Activists on "Legal Mechanisms for Environmental Protection" in partnership with ‘Yuksalish’ Movement.
The forum brought together policymakers, legal experts, environmental specialists, and eco-activists from Uzbekistan and Kazakhstan to discuss evolving environmental policies, law enforcement practices, green urban development, and public participation in decision-making. Experts from Kazakhstan shared insights on Aarhus Convention mechanisms, urban air quality, and eco-startups.
🗣The event featured panel discussions, open debates, and concluded with the presentation of a draft Final Resolution to strengthen environmental governance and legal protection.
#GreenUniversity#EcoForum#Sustainability#EnvironmentalProtection
👉ReadMore _________________
Green University’da Markaziy Osiyo ekologlari va eko-faollari forumi bo‘lib o‘tdi
🔴2026-yil 8-aprel kuni Green University'da “Yuksalish” Harakati bilan hamkorlikda "Atrof-muhitni muhofaza qilishning huquqiy mexanizmlari" mavzusida Markaziy Osiyo ekologlari va eko-faollar forumi bo‘lib o‘tdi.
Forum O‘zbekiston va Qozog‘istondan kelgan siyosatchilar, huquqshunoslar, atrof-muhit bo‘yicha mutaxassislar va eko-faollarni birlashtirib, atrof-muhit siyosatining rivojlanishi, qonun ijrosi amaliyotlari, yashil shaharlarni rivojlantirish va qaror qabul qilish jarayonida fuqarolik ishtiroki masalalarini muhokama qilish imkonini berdi. Qozog‘istonlik ekspertlar Aarhus Konventsiyasi mexanizmlari, shahar havosining sifati va eko-startaplar bo‘yicha o‘z tajribalari bilan o‘rtoqlashdi.
🗣Tadbir panel muhokamalari va ochiq munozaralar bilan o‘tkazilib, atrof-muhit boshqaruvini va huquqiy himoyani mustahkamlashga qaratilgan yakuniy qaror loyihasining taqdimoti bilan yakunlandi.
#GreenUniversity#EcoForum#Barqarorlik#AtrofMuhitniMuhofazaQilish
👉Batafsil
✉️[email protected]
☎️ +998 55 512 00 77
📍Location
🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube
Air Quality Assessment in Termez 2025: Toward Cleaner Air and Clearer Skies
🔴On December 16, 2025, Green University, together with UNEP and the Finnish Meteorological Institute, presented the results of the air quality assessment in Termez. The event brought together government representatives, experts, development partners, media, and civil society.
🔴The assessment, conducted at the request of the National Committee on Ecology and Climate Change of Uzbekistan, was based on data from the first automatic reference air monitoring station installed in Termez in 2024 with the support of the Zamin Foundation. The study identified key pollution sources and provided science-based recommendations to improve air quality.
🔴The discussion also covered new air quality management strategies, including the work of Uzhydromet and youth-focused environmental initiatives by the Zamin Foundation.
#AirQuality#CleanAir#Termez#Uzbekistan#GreenUniversity#UNEP#FMI#ClimateAction#EnvironmentalProtection
✉️[email protected]
☎️ +998 55 512 00 77
📍Location
🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube
Memorandum Signed Between Green University and “Yuksalish” Movement
Within the framework of the Central Asian Forum of Ecologists and Eco-Activists, a Memorandum of Understanding was signed between Green University and “Yuksalish” Movement.
💬The document outlines cooperation in organizing environmental forums, conducting sociological and environmental surveys, supporting innovative startups, and engaging students in volunteer activities.
💬The parties also agreed to expand collaboration through joint research, as well as seminars and conferences.
#GreenUniversity#Yuksalish#MemorandumOfUnderstanding#EcoForum#EnvironmentalProtection#Cooperation
👉ReadMore ________________
Green University va “Yuksalish” Harakati o‘rtasida memorandum imzolandi
Markaziy Osiyo ekologlari va eko-faollari forumi doirasida Green бUniversity va “Yuksalish” Harakati o‘rtasida O‘zaro anglashuv memorandumi imzolandi.
💬Mazkur hujjat ekologlar forumlarini tashkil etish, sotsiologik va ekologik so‘rovlar o‘tkazish, innovatsion startaplarni qo‘llab-quvvatlash hamda talabalarni volontyorlik faoliyatiga jalb etishni nazarda tutadi.
💬Shuningdek, tomonlar qo‘shma ilmiy tadqiqotlar, seminarlar va konferensiyalar orqali hamkorlikni kengaytirishga kelishib oldi.
#GreenUniversity#Yuksalish#Memorandum#EcoForum#AtrofMuhit#Hamkorlik
👉Batafsil
✉️[email protected]
☎️ +998 55 512 00 77
📍Location
🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube