Что делать если нужно поставить какую-то 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
#Jizzakh#Green_School
🌿 Under the Public Association “Ekolog” of Uzbekistan, the “Green School Council” of Jizzakh region organized an environmentally significant
💚 Plogging activity (picking up litter while walking or running). Coordinators and members of the council took part in the event.
📍 During the campaign, Sharof Rashidov main street and surrounding areas were cleaned of waste. Such environmental initiatives not only improve the urban environment but also play an important role in raising ecological responsibility among young people.
🔍 The main goal of the event was to increase environmental awareness among the population and to promote a sustainable lifestyle, as well as a more conscious attitude toward a clean and green environment among youth.
☘️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.
🚀3 Startups Funded at “Investor Day” in Jizzakh
Jizzakh hosted “Investor Day” — a platform for startups from Jizzakh, Tashkent, and Syrdarya regions to pitch their ideas directly to investors.
💡 A total of 11startups presented their projects in front of leading investors, including: AloqaVentures, IT Park Ventures, Startup Garage, Sarmo Ventures, and independent business angels.
🤝 The B2B meeting format also allowed participants to receive practical feedback from top experts:
• Shahzod Narzullayev (IT Park Ventures)
• Davron Parmonov (AloqaVentures)
• Muhammad Khalil (Startup Garage)
• Abdul Sharafiy (Sarmo Labs)
📈 Over 700 young participants attended the event — for many, it became a powerful source of inspiration.
🏆 Investment deals from AloqaVentures:
• Maqsaddosh — $20,000
• Medmap — $20,000
• Mom+ — $20,000
Such regional events play a key role in building the innovation ecosystem and connecting local founders with active investors.
#StartupUzbekistan#InvestorDay#Jizzakh#VentureFunding#TechEcosystem
⚠️ ECOLOGICAL VIOLATIONS ARE BEING IGNORED!
As of January 25, 2026, the activities of LLC “Ko‘mir Ta’minoti” of Jizzakh region, particularly the Dashtabod coal storage facility, continue to cause direct harm to local residents, while grossly violating environmental and sanitary regulations.
Unfortunately, this company continues to operate without complying with basic environmental standards. Coal dust, air pollution, and the absence of protective measures have become a daily problem for the surrounding community.
These violations have been reported several times on our Telegram channel.
📌 Most concerning is the fact that:
Since December 2025, residents and public representatives have repeatedly submitted official complaints to the responsible authorities, yet:
— no effective action has been taken,
— no fines have been imposed,
— no official explanations have been provided to the public.
❗️ This raises serious questions:
Why are environmental violations going unpunished?
Why is public health being ignored?
We, as citizens and representatives of civil society, demand an urgent review of this situation and request written, official information regarding:
— the identified violations,
— the measures taken in response,
— the fines imposed (or not imposed) on this enterprise.
🟢 Environmental protection is not a formality.
🟢 It is a matter of human health, children’s future, and the right to a clean environment.
Responsible authorities must not remain silent.
The public will continue to closely monitor this case.
#Ecology
#EnvironmentalViolations
#Dashtabod
#Jizzakh
#PublicHealth
#PublicOversight☘️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.
🇺🇿🚀 BMB AGRO PLUS: ғоядан — экспортгача!
Эсингизда бўлса, яқиндагина Жиззахда BMB Agro Plus — инновацион корҳонамизнинг очилиши бўлиб ўтган эди. Ушбу лойиҳа маҳсулотни шок ва акустик музлатиш технологияси асосида чуқур қайта ишлаш учун яратилган.
📦 Бугун лойиҳа амалий босқичга ўтмоқда:
илк юқори технологияли музлатилган маҳсулот партияси Европага экспорт қилинди!
☝Бу — BMB Holding стратегиясининг амалдаги ифодаси: етиштириш, қайта ишлаш ва экспорт қилиш.
🇺🇿Ўзбек даласидан — 🇪🇺Европа супермаркетларининг расталаригача!
Ва бу — фақатгина бошланиши.
🔹 BMB Holding — келажак сари дадил одимламоқда!
#BMBHolding#BMBAgroPlus#Jizzakh#MadeInUzbekistan#UzAgroExport#АгроЭкспорт#Инновации#ШоковаяЗаморозка#AgroTech#ExportReady#AgroFuture#УзбекистанЕвропа#BMBданЕвропага
@bahodir_schastlivchik