Что делать если нужно поставить какую-то 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
Central Bank Politicization in Ethiopia and Implications for Creditors. Read more.
https://borkena.com/2026/02/26/ethiopia-central-bank-politicization-in-ethiopia-and-implications-for-creditors/#Ethiopia#CentralBank#Bank
Nabiullina: Russia Faces Labor Shortage for the First Time
At the Alpha Summit, Central Bank Chair Elvira Nabiullina stated that modern Russia is experiencing an unprecedented labor shortage. This situation significantly impacts the economy and regulatory decisions. Nabiullina emphasized that more timely data would improve labor market analysis. Such a workforce deficit presents a new challenge for the country’s economy.
#Russia#CentralBank#Nabiullina#LaborMarket#Economy
The main news of Russia and the world ishere.
Russian Ministry of Economic Development Welcomes Central Bank’s Rate Cut
The Russian Ministry of Economic Development views the Central Bank’s seventh consecutive key rate reduction—from 15.5% to 15.0%—as a positive signal. The ministry highlights that easing monetary policy supports the economy’s shift toward sustainable growth, especially amid improvements in various sectors. This decision fosters business development and an improved investment climate.
“Lowering the rate is a crucial step to support the economy,” the ministry emphasized.
#Russia#Economy#CentralBank#KeyRate#EconomicDevelopment
The main news of Russia and the world ishere.
Russian Stock Market Opens Week with Moderate Decline
On April 29, the Moscow Exchange and RTS indexes fell 0.3%, reacting to the Central Bank of Russia’s cautious signals on monetary policy. Meanwhile, oil prices rose amid ongoing geopolitical tensions in the Middle East. Biggest losers included Group Pозитив (-2.2%), Yandex (-2.1%), and MMK (-1.8%). The official dollar rate stands at 75.53 rubles.
The market reflects both domestic and external challenges, showing investor caution.
#Russia#StockMarket#MoscowExchange#RTS#CentralBank
The main news of Russia and the world ishere.
Czech Central Bank Eyes Bitcoin Investment
Czech National Bank considers Bitcoin investment, stated Governor Aleš Michl. Proposal could diversify 5% of $146 billion reserves. Details: ForkLog
#CzechRepublic#Bitcoin#Crypto#Investments#CentralBank#Finance#AlešMichl#Reserves#ForkLog
Czech Bank Considers Bitcoin Investment
Aleš Michl, Governor of the Czech National Bank, suggests possible Bitcoin acquisition for diversification of foreign reserves. Board decision pending. Plans to raise gold reserves to 5% by 2028. Read more.
#CzechRep#Bitcoin#Finance#Investing#Gold#Reserves#CentralBank#Diversification#Crypto#Economy
⚠🇷🇺🏦 From July 25, your financial transaction in Russia may be blocked and refunds may be issued without your consent if it falls under the following categories:
📌 If It is made to an account in the bank's database for fraudulent transactions. It may be the sending or receiving bank's database.
📌 If there is information about the initiation of a criminal case from a client or other interested party
📌 If data is received from third-party organizations indicating a fraudulent transaction (for example, information from a telecom operator about unusual telephone activity for the client before the transfer of funds or an increase in the number of incoming messages from new numbers, including in instant messengers). Please note "including instant messengers")
On the same day, an order will also come into effect, according to which banks will have to return money, including those voluntarily transferred to fraudsters, to clients within 30 days of their request.
There are three grounds for this refund:
1. If the account to which the funds were transferred is in the fraudulent database;
2. If the bank did not notify the client about the transfer without his consent;
3. If the card was lost or used without the client's consent. In the latter case, the client must notify the bank about the loss, otherwise the bank has the right not to return the funds.
Subscribe:@nido_russia
https://t.me/nido_russia/1715
#news#Russia#finance#fraud#crime#centralbank#цб#сb
🚀 Bank of Japan Governor: Underlying Inflation Gradually Approaching Target
Bank of Japan Governor Kazuo Ueda stated that the underlying inflation rate is gradually accelerating towards the central bank's target. According to Jin10, Ueda emphasized the importance of monitoring inflation trends closely to ensure they align with the Bank of Japan's objectives. The central bank remains committed to its monetary policy framework to achieve stable price growth.
#BankOfJapan#Inflation#MonetaryPolicy#KazuoUeda#EconomicStability#CentralBank
U.S. Bitcoin Reserve Gains Traction
Growing support for a U.S. Bitcoin reserve post-Trump's inauguration. Estimates show a 64% chance for the reserve by 2025 via Polymarket. The proposal under the BITCOIN Act aims to accumulate 1M bitcoins over five years. Advocates highlight potential benefits while critics voice concerns about volatility and logistical issues. The initiative reflects a broader trend of governments exploring digital assets, alongside China's digital yuan advancements. More on the future implications of this movement on global finance.
#Bitcoin#Crypto#VC#Finance#DigitalAssets#Polymarket#Blockchain#Trump#Economy#Investment#Innovation#CentralBank#Cryptocurrency#DigitalDollar#China#Gold#Assets
🚀 Poland's Central Bank Governor: No Need for Rate Hike, Rate Cuts Paused
Poland's Central Bank Governor, Adam Glapiński, stated that there is no need to raise interest rates, and that the recent cycle of rate cuts has been paused. According to Jin10, Glapiński emphasized that the current economic conditions do not warrant an increase in rates, suggesting a stable monetary policy stance for the foreseeable future. This decision comes amid ongoing assessments of Poland's economic performance and inflation trends.
#Poland#CentralBank#InterestRates#MonetaryPolicy#Economy#Inflation#RateCuts
🚀 Venezuela's Inflation Rate Reaches 13.1% in March
Venezuela's central bank reported that the country's inflation rate reached 13.1% in March. According to Jin10, the inflation rate for the first quarter of 2026 was recorded at 71.8%, reflecting ongoing economic challenges in the nation.
#Venezuela#Inflation#Economy#CentralBank#EconomicCrisis #2026 #FinancialNews
🚀 Poland's Central Bank Keeps Benchmark Rate Unchanged at 3.75%
Poland's central bank has decided to maintain its benchmark interest rate at 3.75%, aligning with market expectations. According to Jin10, this decision reflects the bank's current monetary policy stance amid ongoing economic conditions. The unchanged rate suggests a cautious approach as the bank monitors inflationary pressures and economic growth. This move is consistent with the central bank's efforts to balance economic stability and inflation control.
#Poland#CentralBank#InterestRate#MonetaryPolicy#Inflation#EconomicGrowth#EconomicStability