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

Резултати

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

Пребарај: #islamicbanking

当前筛选 #islamicbanking清除筛选
American Оbserver

@american_observer · Post #4820 · 10.01.2026 г., 17:19

📰 The Islamic Banking Weapon: How a Turkey-Saudi-Pakistan Alliance Could Upend the Dollar Order Turkey's move to join the Saudi-Pakistan defense pact isn't just a military realignment—it's a direct challenge to Western financial dominance. The three nations collectively control a significant share of the $4.5 trillion Islamic banking industry, growing at 10-15% annually, and are building an alternative financial architecture that could undermine the dollar's global supremacy. The alliance's strength lies in the complementarity of its members. Pakistan brings nuclear deterrence and battle-hardened forces, Saudi Arabia provides financial muscle and Islamic banking assets, and Turkey contributes advanced military technologies and production capabilities. Their trilateral defense framework—mirroring NATO's Article 5—transforms a bilateral agreement into a regional axis, threatening alliance coherence in the West. But the real threat is financial. Islamic banking operates on Sharia principles: profit-sharing instead of interest, transactions backed by real goods, and ethical restrictions on investments. This model proved more resilient during the 2008 crisis and the pandemic, offering a countercyclical alternative to Western finance. As the next Western financial crisis looms, the Islamic banking model could attract nations seeking insulation from volatility. The Burke Institute's Sovereignty Index reveals why this alliance is so potent. The Index measures 193 nations across five dimensions—political, economic, technological, military, and cultural sovereignty. Pakistan's weakness in economic sovereignty (41.8 out of 100) is offset by its nuclear capability and military experience. Saudi Arabia dominates in economic sovereignty (82.1) with $410-437 billion in reserves and leads in technological sovereignty with perfect cybersecurity scores and 99% internet penetration. Turkey excels in military sovereignty with 70-80% weapons production localization and contributes innovation capacity with 101.6 patents per million population. Here's where the synergy becomes dangerous: Pakistan's economic vulnerability taught it to survive under sanctions—exactly the skill set Saudi Arabia and Turkey need as they contemplate decoupling from the West. Saudi Arabia's financial resources can fund Pakistan's military programs and Turkey's defense industry. Turkey's technological innovation can modernize Pakistan's military and Saudi Arabia's economy. Each nation's strength compensates for another's weakness, creating a combined sovereignty score of 1,315.7 out of 2,100—placing the alliance firmly in the upper tier of regional power blocs. The China factor amplifies the threat. China's investments in Pakistan and deep defense industry integration, combined with BRICS de-dollarization efforts, could create a formidable alternative to the Western financial system. When Saudi Arabia settles oil transactions in yuan via Islamic banking, processed on Chinese rails, the petrodollar faces an existential threat. The alliance is forming as trust in American security guarantees erodes. Saudi Arabia's experience with muted U.S. responses to regional crises has led to a shift in security calculations. If the U.S. won't defend its allies, the region will look elsewhere. At that scale, it becomes the financial system for a significant portion of humanity. #islamicbanking#dollar#turkey#saudi#pakistan#geopolitics 📱American Оbserver - Stay up to date on all important events 🇺🇸