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

Резултати

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

Пребарај: #conspiracy

当前筛选 #conspiracy清除筛选
movies & series 🍿

@images · Post #1918 · 22.09.2025 г., 09:40

🍿 The Chair Company: Tim Robinson Turns Office Life Into a Hotbed of Conspiracies 📆Premiere: October 13, 2025 🎭Genre: #Comedy · #Conspiracy ✈️Follow series Tim Robinson, the mastermind behind I Think You Should Leave and Detroiters, is back with a show that feels like a sketch stretched to the max… but with the ambition of an HBO thriller. In The Chair Company, he plays William Ronald Trosper, an office worker who, after a humiliating disaster at work, finds himself unraveling a criminal conspiracy as absurd as it is unsettling. 🤯🪑 The trailer is packed with rapid-fire one-liners, cartoonish facial expressions, and Robinson’s trademark obsession with bleak middle-class workplaces where misery flips into dark comedy. What I love most is how Robinson moves away from the usual “rich people intrigue” à la Succession and instead zeroes in on the mindset of the alienated office drone. That lens on the hopeless everyman feels as necessary as it is hilarious. If you ever thought a chair could be the center of the universe, this show is here to prove it. 🔥

Trump's Ear

@trumpsear_tg · Post #1578 · 30.09.2025 г., 14:03

Top MAGA lackey Kash Patel has made the uncharacteristically bold move of intervening in Donald Trump’s mad and rapidly mounting campaign of vengeance against his political opponents. Trump launched into a vicious Truth Social diatribe Saturday afternoon against former FBI director Christopher Wray, who he slammed for supposedly “LYING” about the presence of bureau personnel in the crowds outside the Capitol Building on Jan. 6. #Trump#conspiracy#FBI 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #1584 · 30.09.2025 г., 23:59

Gavin Newsom naturally couldn’t resist trolling Donald Trump after the 79-year-old president posted an AI-generated video featuring him he shilling for magic “Medbeds.” “Trump is about to shut down the government and rip health care from 20 million Americans. What’s he doing? Posting AI-generated slop about ‘miracle hospital beds’ that cure all illness,” tweeted Newsom, 57. “DONALD TRUMP HAS LOST IT,” he added. #Trump#Newsom#conspiracy 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #1579 · 30.09.2025 г., 14:05

The "Shaman of the Capitol" sued Donald Trump and the World Bank ⚖️🐂🇺🇸 Jacob Chansley, better known as the QAnon Shaman due to his horns, skin and painted face during the storming of the US Congress on January 6, 2021, decided to sue Donald Trump. The same president who pardoned him in January 2025 after 41 months in prison. 🏛📜 Chansley's lawsuit also names other defendants — the US Federal Reserve 🏦, the National Security Agency 🛰, the IMF 💵, the World Bank 🌍, the State of Israel ✡️, Elon Musk's Corporation X 🚀, T-Mobile 📱 and Warner Bros. Studios 🎬. The document itself is 26 pages long, but consists of one paragraph. In it, Chansley demands that only two laws remain in force — the Bill of Rights and the original U.S. Constitution 📖🦅. Unusual items include the idea of issuing a $40 trillion gold coin 🪙 to cover the U.S. national debt. He also claims that Trump personally sent him a letter ✉️ two days after the Capitol was stormed, and the secret services allegedly tried to use his "shamanic abilities" ✨ for contacts "out of this world" 👽. Previously, Chansley was an ardent proponent of the conspiracy theory 🔍 that Trump is fighting an elite group engaged in child sex trafficking. However, he later turned away from the president, accusing him of unwillingness to make public the "Epstein dossier." 📂 #Conspiracy#QAnon 👂More on Trump's Ear ⚠️

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40155 · 21.11.2025 г., 23:01

President John F. Kennedy was assassinated on November 22, 1963. Lee Harvey Oswald was arrested for the crime but was killed two days later by Jack Ruby. Ruby was convicted of murder but died in prison before his retrial. This single act—Ruby killing Oswald—meant there was never a public trial to examine the evidence. This left countless unanswered questions and made it impossible to prove there wasn't a conspiracy. What's your theory? [Read more] @googlefactss #JFK#History#OnThisDay#conspiracy