Что делать если нужно поставить какую-то 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
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
🎮 А у нас на платформе новая игра! Играя в нее вы научитесь проверять изображения, прокачаете критическое мышление, станете более внимательными к деталям.
🔍 В современном мире фейки встречаются на каждом шагу. Новости, статьи, фотографии, видео - все может быть подделкой. Умение распознавать фотофейки - это важный навык, который поможет вам не стать жертвой обмана.
🎓 Играйте и учитесь!
📸🔍📸🔍📸🔍📸🔍
🎮 Bizning platformamizda esa - yangi o'yin! Uni o'ynash orqali siz tasvirlarni tekshirishni, tanqidiy fikrlashni yaxshilashni va tafsilotlarga ko'proq e'tibor berishni o'rganasiz.
🔍 Zamonaviy dunyoda feyklar va soxta narsalar har qadamda topiladi. Yangiliklar, maqolalar, fotosuratlar, videolar - hammasi feyk bo'lishi mumkin. Feyk fotosuratlarni fosh etish qobiliyati sizni aldov qurboni bo'lmaslikka yordam beradigan muhim ko'nikmadir.
🎓 O'ynang va bilim toping!
#qlever#oyin#fakes#tanqidiyfikrlash#photofake#qlever#игра#фейки#критическоемышление#фотофейк
🎮Qlever
📹Instagram
💬Telegram