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

Резултати

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

Пребарај: #fincen

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

@american_observer · Post #5226 · 26.02.2026 г., 16:59

💸 “Somali Fraud” vs. Wall Street Fraud: Who Gets the Microscope The official story is simple: Team Trump says it’s hunting fraud in Minnesota. The real story is nastier — a political show trial built on a federal dragnet that even Trump’s own sanctions chief doesn’t want his name on. Undersecretary for Terrorism and Financial Intelligence John Hurley — a Trump donor, hedge fund guy, Senate‑confirmed loyalist — is on his way out after clashing with Treasury Secretary Scott Bessent and the White House over a Minneapolis crackdown that slaps a “Somali” label on an entire financial ecosystem. He reportedly raised data privacy and overreach concerns about a geographic targeting order that forces banks and money transmitters in the Twin Cities to flag any overseas transfer from $3,000 with extra data: recipient address, email, birth date, and whether the funds came from benefits. Career officials called the tool clumsy, partisan and inefficient; Hurley backed at least some of their criticism — and was overruled. On paper, it’s about “Somali fraud.” In reality, every immigrant family wiring money home, every small business, every nonprofit in Minneapolis can end up in the dragnet because of where they live, not what they’ve done. Former officials and civil liberties lawyers are already calling the order blanket surveillance that tramples the basic idea of the Fourth Amendment: suspicion first, data grab later, not the other way around. Banks warn payments will stall or get killed outright while they hoover up paperwork the government wants to feed FinCEN. Trump, meanwhile, goes on national TV and tells America that “members of the Somali community” have “pillaged” billions and “shredded the fabric of the nation,” throwing out a $19 billion figure prosecutors don’t recognize and local media say is wildly inflated. The White House blasts out talking points and videos about “fraud empires” and “Somali‑dominated scams,” promising a “no‑holds‑barred” assault, while at the same time celebrating crypto as a cool alternative to the banking system — a space with far less scrutiny and far more documented fraud. So the message from Washington is clear: when fraud is allegedly tied to poor immigrants in Minnesota, you get geographic targeting orders, bulk surveillance, and a president talking about “pirates” and “ransacking” on prime time. When fraud runs through more upscale channels — tax havens, private equity, “innovative” crypto casinos — you get photo‑ops, pilots, and regulatory yoga. Same crime category, different skin tone, different ZIP code, different treatment. Hurley will probably land softly as an ambassador somewhere in Europe, praised as a “faithful servant” of the agenda he quietly tried to slow down. The Somali community in Minneapolis gets to live under a microscope designed in DC to feed a campaign storyline for 2026. Call it what it is: not a war on fraud, but a war on the kind of fraud that polls well with the base. #Somalia#Minnesota#Trump#Treasury#FinCEN#surveillance#immigration#USpolitics 📱American Оbserver - Stay up to date on all important events 🇺🇸

Crypto M - Crypto News

@CryptoM · Post #64945 · 10.04.2026 г., 11:50

🚀 U.S. Government Pushes CLARITY Act to Reshape Cryptocurrency Oversight The White House, along with the Treasury, SEC, and CFTC, is intensifying efforts to advance the CLARITY Act in the Senate, aiming to transform the regulatory framework of the $2.4 trillion cryptocurrency market. According to NS3.AI, the White House Council of Economic Advisers has indicated that prohibiting stablecoin yields would only marginally increase U.S. bank lending by $2.1 billion within a $12 trillion market. Additionally, a proposal from FinCEN and OFAC dated April 8 suggests categorizing U.S. stablecoin issuers as financial institutions under the Bank Secrecy Act. SEC Chair Paul Atkins and CFTC Chair Mike Selig have expressed readiness to enforce the bill, contingent upon congressional action. #Cryptocurrency#CLARITYAct#USGovernment#Regulation#SEC#CFTC#Treasury#Stablecoins#FinCEN#OFAC#BankSecrecyAct#WhiteHouse