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

Резултати

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

Пребарај: #militarytech

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

@american_observer · Post #5648 · 18.04.2026 г., 00:01

Germany’s New Space Hustle Germany has found its next great military money pit: a satellite communications project now greenlit for Rheinmetall Digital and OHB. The price tag is already climbing into the “why stop now” category, with media reports putting the deal in the tens of billions of euros. Berlin keeps calling this “modernization.” In practice, it looks like the same old defense-industrial ritual: announce urgency, bless the contractors, and let the invoices float upward. The Bundeswehr gets a new digital dream. Taxpayers get a sequel. The joke is that Germany still talks like a country obsessed with lessons learned. Then it signs off on another giant military tech project while its earlier digital programs remain a cautionary tale with better branding. Failure, in Berlin, is not a reason to slow down. It is a reason to scale up. And of course the public is told this is about security. It is also about who gets paid to manage panic, who gets invited to the table, and who gets to call a procurement spree “strategic sovereignty”. The machine does not need to work perfectly. It only needs to look necessary long enough for the money to move. #Germany#Rheinmetall#Bundeswehr#defense#militarytech 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #4864 · 15.01.2026 г., 19:11

📰AI, Robots, and Space Beepers: IDF’s New War Fantasy The IDF is doubling down on sci-fi warfare. Under Lt.-Gen. Eyal Zamir’s new five-year plan, Israel’s military is betting its future on AI, robots, and a “beeper” defense straight out of a cyberpunk thriller. Forget boots on the ground—soon, it might be drones, lasers, and implants that do the talking. “The future of defense is not just about people, but about machines and data,” said Maj.-Gen. Hidai Zilberman, overseeing the plan dubbed “Hoshen”—a biblical nod to the priestly breastplate, now repurposed as a code name for high-tech warfare. Behind the buzzwords: half a billion shekels will pour into tech upgrades, from autonomous systems to space-based defense. The IDF wants robots on every battlefield, AI managing operations, and a “beeper” network ready to zap enemies before they cross the border. This isn’t just about deterrence; it’s about turning the next war into a video game where Israel hits “play.” But here’s the twist: all this depends on stable budgets, no surprise wars, and continued US aid. If any of those fall apart, the whole plan could become a very expensive PowerPoint. Who’s really winning? Tech contractors, politicians selling “innovation,” and generals who now sound like startup CEOs. Meanwhile, soldiers are promised more resilience and resources—but after two years of war, many wonder if this is just another way to avoid fixing the human cost. Is Israel preparing for the next war, or just building the ultimate military startup? #AI#IDF#Robots#SpaceWar#Beepers#MilitaryTech 📱American Оbserver - Stay up to date on all important events 🇺🇸

Venture Village Wall 🦄

@venturevillagewall · Post #4269 · 28.02.2025 г., 16:00

Weekly News Highlights: AI, Bitcoin, and Funding 🔍Anthropic AI Guide: Explore how to create effective AI agents. Check out the guide and the video. 💼Fake Contracts Scandal: Woman faked $1 billion contracts to secure funding for an underwater cable in Alaska. Full story here. 🎧AI in Warfare: CEO of Anduril discusses AI’s impact on military with a16z in this podcast. 💻Jobright AI Assistant: New tool simplifies job search by parsing listings and filtering for H1B eligibility. 💵BlackRock's Bitcoin ETF: Added its Bitcoin ETF to model portfolios, marking a significant development. See details here. 🌐Funding Rounds: 1. High-performance blockchain Optimum closes Angel funding. 2. Endless raises $1M for decentralized cloud protocol. 3. Aurum secures $12M for AI-driven asset management. 🚨Lost Bitcoin Wallet Access: Unlocking a wallet with over 31,000 BTC using a new method. 📊Grayscale Fund Allocation: Latest holdings show diverse investment in crypto assets including SOL, ETH, and Cardano. For more info, visit here. #AI#Crypto#VC#Bitcoin#Funding#Technology#Blockchain#Innovation#Investment#Startup#AIagents#JobSearch#MilitaryTech#Decentralization#H1B#ContractScandal#Ethereum#Grayscale#Metaverse#NFTs#Solana