TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #210 · 3 фев.

Что делать если нужно поставить какую-то 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

Резултати

Пронајдени 9 слични објави

Пребарај: #nbe

当前筛选 #nbe清除筛选
Addis Standard

@addisstandardeng · Post #21045 · 12.01.2026 г., 10:30

#Policy_Brief: #Ethiopia’s Banking Sector Transition to Basel II and III: Critical assessment of #NBE’s new directive In November 2025, the National Bank of Ethiopia (NBE) issued Directive No. SBB/95/2025, transitioning the banking sector toward Basel II and III frameworks. While officials view this as a “mark of maturity,” author Hassen Mama Muse contends that “implementing such a complex system in an economy with limited data infrastructure and human capital may outweigh the perceived benefits.” He argues the directive “grafts a highly sophisticated, Western-centric regulatory model onto a developing financial system that lacks the requisite infrastructure,” citing a global history of “technocratic failure.” Hassen cautions that success rests on “prioritizing simplicity, transparency, and domestic economic stability over technocratic elegance,” emphasizing that for Ethiopia, “resilience must be real, not merely compliant on paper.” https://addisstandard.com/?p=54480

Addis Standard

@addisstandardeng · Post #21384 · 12.02.2026 г., 12:33

News: National Bank amends #forex directive allowing international payment cards, easing FX account rules The National Bank of #Ethiopia (#NBE) has issued a new foreign exchange directive allowing domestic banks to issue internationally recognized payment cards and introducing a series of measures aimed at easing foreign exchange administration and supporting business activity. Directive No. FXD/04/2026, which came into force on 12 February 2026, amends the earlier foreign exchange directive issued in 2024. The central bank said the revision is intended to relax foreign exchange administration, enhance market development, and strengthen business confidence. Among the key changes, banks are now permitted to issue internationally recognized prepaid or debit cards for foreign currency account holders & load foreign currency based on customer instructions without requiring visas or air tickets. The directive also authorizes banks to process advance payments... Read more: https://addisstandard.com/?p=55158

Addis Standard

@addisstandardeng · Post #21439 · 18.02.2026 г., 13:43

News: National Bank of #Ethiopia appoints external members to monetary policy committee The National Bank of Ethiopia (#NBE) has announced the appointment of two external members to its Monetary Policy Committee (#MPC), saying the move is intended to strengthen analytical capacity and support evidence-based monetary policy decisions. In a statement issued Wednesday, the central bank said the appointments were approved by the NBE Board following a presentation by the governor and are in line with the amended National Bank proclamation. The bank said including external members is aimed at enhancing the committee’s expertise and supporting well-informed policy deliberations. According to the statement, the appointees are experienced economists with strong academic backgrounds and professional expertise in macroeconomic analysis and policy. https://www.facebook.com/share/p/1AVni8xNvG/

Borkena

@borkena · Post #5911 · 03.03.2026 г., 13:54

ብሔራዊ ባንክ ለውጭ ምንዛሪ ጨረታ ያቀረበው 70 ሚሊዮን ዶላር ከባንኮች ፍላጎት በ107 ሚሊዮን ዶላር አነሰ። ​የኢትዮጵያ ብሔራዊ ባንክ ለ20ኛው ዙር የውጭ ምንዛሪ ጨረታ 70 ሚሊዮን ዶላር ለገበያ አቅርቧል። ይሁን እንጂ የንግድ ባንኮች ያቀረቡት ፍላጎት ከ177 ሚሊዮን ዶላር የበለጠ ነው። ይህ የባንኩ መረጃ እንደሚያሳየው፣ ከግማሽ በላይ ወይም 107 ሚሊዮን ዶላር የሚሆነውየባንኮች ፍላጎት አለመመለሱን ነው ተብሏል። በ​ጨረታው ከተሳተፉት 20 ባንኮች መካከል አሸነፉ የተባሉት ዘጠኙ ብቻ ናቸው። ይሁን እንጂ ቀሪ 11 ባንኮች እና ደንበኞቻቸው ለውጭ ምንዛሪ እጥረት ተጋልጠዋል። በተጨማሪም፣ የኅዳግ ተመኑ ወደ 155.88 ብር ከፍ ማለቱ በገቢ እቃዎች ዋጋ ላይ የሚኖረው ተፅዕኖ አሳሳቢ ነው ተብሏል። #Ethiopia#AddisAbaba#NBE#Ethiopiannews#news#ዜና

Addis Standard

@addisstandardeng · Post #21163 · 23.01.2026 г., 09:22

News: #IMF-backed forex reforms cost #Ethiopia $2.6 billion in central bank losses Ethiopia’s central bank, the National Bank of Ethiopia (#NBE), has recorded losses equivalent to $2.6 billion following the country’s shift from a fixed to a market-based foreign exchange regime in July 2024, according to audited financial statements cited by the #Kenyan outlet The EastAfrican. NBE said it incurred 407.1 billion birr in foreign exchange losses during the financial year ending June 30, 2025, largely due to the revaluation of its foreign currency assets and liabilities after the exchange rate realignment. Foreign exchange losses rose sharply to 445.23 billion birr, from 38.13 billion birr the previous year. The surge pushed the National Bank of Ethiopia’s overall operating loss to 428.56 billion birr, up from 10.51 billion birr a year earlier, and drove the Bank into a negative equity position of 380 billion birr, raising concerns over its ability to continue... Read more: https://addisstandard.com/?p=54706

Addis Standard

@addisstandardeng · Post #21881 · 30.03.2026 г., 10:28

#Policy_Brief: Consolidate or Collapse: Mergers and acquisitions as strategic lifeline for #Ethiopian banks In this policy brief, Samson Hailu contends that Ethiopia’s banking sector is entering a critical phase, as consolidation —particularly through mergers and acquisitions— shifts from a private-sector discussion to a policy priority of the #NBE under Governor Eyob Tekalign. Although the sector has expanded to 31 banks, the #CBE continues to dominate, leaving smaller institutions vulnerable. Stress tests highlight significant capital and liquidity risks, reinforcing the author’s warning that “consolidation is not merely a strategic choice but a requirement for survival.” He recommends that smaller “third-generation” banks form partnerships with larger private banks and endorses a “guided voluntary” approach, designed not to mandate consolidation but to facilitate market-led combination. https://addisstandard.com/?p=56167

Addis Standard

@addisstandardeng · Post #21279 · 02.02.2026 г., 13:04

#Ethiopia: National Bank to phase out #gold premium, open purchases to private banks; #IMF warns exchange rate challenges hinder private investment The National Bank of Ethiopia (#NBE) is overhauling its gold transaction procedures to reduce risks to its balance sheet and curb distortions in the banking sector, according to the International Monetary Fund’s (IMF) latest review of Ethiopia’s Extended Credit Facility (#ECF) program. Under the new framework, the premium above international gold prices currently paid to miners will be phased out, while private banks will be allowed to participate in gold purchases. The NBE plans to develop a detailed implementation roadmap based on a study expected by the end of March 2026. In the meantime, quality control will be strengthened through expanded and improved gold testing at all purchasing sites. The central bank also intends to prepare a long-term exit plan from the gold market by the end of December 2026,... Read more: https://addisstandard.com/?p=54903

Borkena

@borkena · Post #5975 · 11.03.2026 г., 14:35

ክሱን በፍቃዳቸው አቋረጡ። እነ አቶ ጌታቸው ረዳ በምርጫ ቦርድ ላይ የመሰረቱትን ክስ አነሱ የዲሞክራሲያዊ ስምረት ትግራይ (ስምረት) ፓርቲ ሊቀመንበር የሆኑት አቶ ጌታቸው ረዳ፣ በኢትዮጵያ ብሔራዊ የምርጫ ቦርድ ላይ መስርተውት የነበረውን ክስ በገዛ ፈቃዳቸው ማንሳታቸውን ለፍርድ ቤት አስታውቀዋል። ​ ከሳሾች ክሱ አሁን ባለው ሁኔታ ውጤት እንደማያመጣ በማመናቸው በፈቃዳቸው አንስተዋል ተብሏል። ክሱ በመነሳቱ ምክንያት ቀደም ሲል በቦርዱ ውሳኔ ላይ ተጥሎ የነበረው የጊዜያዊ እገዳ ትዕዛዝ ተሰርዟል። ​ በዚህም መሰረት የምርጫ ቦርድ ያስተላለፈው ውሳኔ በቀጥታ ተፈጻሚ ይሆናል። ​​#Ethiopia#AddisAbaba#Ethiopian_news#news#houseoffederation#GetachewReda#NBE#ዜና#ምርጫ#ጌታቸውረዳ

Addis Standard

@addisstandardeng · Post #21939 · 04.04.2026 г., 07:44

News: #National_Bank lists 23 unauthorized money transfer providers, warns public against use The National Bank of #Ethiopia (#NBE) has identified 23 unauthorized money transfer service providers and warned the public against engaging with them, according to a public notice issued on 3 April 2026. The central bank said it has updated and published a revised list of duly licensed money transfer agents authorized to operate in Ethiopia, urging the public to verify service providers through its official website. The entities listed as unauthorized include #Adulis Money Transfer, #Amal Express, #Bakaal Money Transfer, #Jubba Express, #Quick_Pay, #Redsea (USA), Tasa Pay. In late December 2025 Addis Standard reported that, the National Bank of Ethiopia (NBE) published an official list of more than 100 licensed money transfer agents and cautioned the public against using unlicensed remittance services. Read more: https://addisstandard.com/?p=56305