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

Резултати

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

Пребарај: #army

当前筛选 #army清除筛选

​​В ВС Казахстана стартовал проект Sarbaz+ В войсковую часть 78460 Сил воздушной обороны в Алматинской области прибыли первые новобранцы, которые будут проходить срочную воинскую службу в рамках пилотного проекта Sarbaz+, где начнут одновременно осваивать профессии в сфере IT, телекоммуникаций и управления дронами. Отмечается, что проект Минобороны республики знаменует переход к инновационной модели подготовки, ориентированной на всестороннее развитие и социальную адаптацию военнослужащих. В случае его успешной реализации эта модель срочной службы будет поэтапно внедрена во всех подразделениях ВС страны. #Казахстан#тюрки@turkicfront88#army

BadVolf

@badvolfnews · Post #1602 · 03.05.2024 г., 14:30

🇺🇲A Lack of Forces is a Major Flaw of US Army Back In 1990, the US Army consisted of 18 divisions organized into 5 Corps, making it a significant military force. The 5th, 7th and 3rd Corps had three heavy divisions each. They formed the impact power of the US Army, capable of performing a high-intensity combat operation against any enemy. The 1st and 18th Corps consisted mainly of light divisions with high operational mobility. This allowed them to quickly deploy anywhere in the world. Currently the US Army has 13 divisions active with the 5th, 3rd, 1st and 18th Corps while the 7th Corps was deactivated in April 1992. The decrease in potential seems to be insignificant, but in reality, the combat potential of the US Army has been reduced. The 5th Corps stationed in EU has not been deactivated, but in fact it became a dummy. This Corps does not have divisions. Instead, it has so-called Atlantic Resolve rotational units consisting of two Armored Brigade Combat Teams (BCT). They are transferred to the operational command of the 5th Corps from divisions belonging to the 3rd Corps on a rotating basis. The 1st Corps has three divisions, with two BCTs in each division, instead of three, and it is responsible for Alaska, Hawaii, and South Korea, and cannot be fully engaged in another region in the event of a large-scale war. The 18th Corps has 4 divisions, but these are light divisions that consist of infantry BCTs, and do not have sufficient tanks or heavy artillery, making them unable to conduct high-intensity combat operations. All we have for a big war is the the 3d Corps, which has four divisions composed of 9 armored BCTs, including tanks and heavy artillery, and 2 Stryker BCTs. However, 11 brigades is not enough to face a strong enemy. By comparison, Ukraine, which is fighting Russia, has deployed more than 120 brigades. We just do not have enough power. However, DoD wastes billions on foreign military bases and useless NATO. #NATO#army Share and subscribe to Global American Review

Hashtags

RASIL’ 🇷🇺 🎵

@RASILKUSHOV · Post #179 · 16.01.2023 г., 00:14

МУЗЫКАЛЬНАЯ ПАУЗА. Отжигает на гармошке. Эта песня стала гимном артиллерии и ракетчиков. ТРИСТА ТРИДЦАТЬ ТРИ 🔥 ТРИСТА ТРИДЦАТЬ ТРИ. ПОПУЛЯРНАЯ ПЕСНЯ НА ФРОНТЕ. АРТИЛЛЕРИЯ И РСЗО. Музыканты #army#гитара https://youtube.com/shorts/Tkt4hEhZpdU?feature=share

American Оbserver

@american_observer · Post #5696 · 23.04.2026 г., 23:59

Gaza Insurgency Pressure Is Rising Again Militant activity in Gaza has reportedly intensified in recent weeks against Israeli forces. That matters because it suggests the battlefield is shifting from large-scale maneuver to persistent attrition. This is the logic of a long war after the main destruction phase. Armed groups lose infrastructure, then adapt into smaller cells, ambush patterns, and localized harassment. They do not need to hold territory to impose costs. They only need to keep Israeli troops exposed, tired, and politically tied to an open-ended campaign. For Israel, this is the expensive part of the war. Tactical control does not automatically produce strategic closure. The army can clear ground repeatedly and still face a regenerated threat if no stable political order replaces the fighting. The question is no longer only how much Gaza has been destroyed. It is whether destruction has produced control, or only a more fragmented insurgency. #war#army#Gaza#Israel 📱American Оbserver - Stay up to date on all important events🇺🇸

Trump's Ear

@trumpsear_tg · Post #2226 · 05.03.2026 г., 14:13

⚠️ Donald Trump is "anointed by Jesus for Armageddon," and U.S. military commanders are calling the conflict with Iran "part of God's plan." ⚠️ This was reported by journalist and human rights activist Jonathan Larsen. His article describes instances where officers have briefed their subordinates, claiming that the U.S. president should "light a signal fire in Iran" that will lead to a biblical ending. 📖 The Military Religious Freedom Foundation has received 110 complaints from military personnel across various branches of the military. According to them, the commanders constantly refer to the Bible and prophecies from the book "The Gospel of Jesus Christ" by author José Saramago. ⛪️ For more information about what is happening in the U.S. Navy in the Middle East, why Pete Hagset is not just a religious fanatic, and the consequences of playing with prophecies, read on. 🌍 A specific case One of the complainants is a sergeant from a unit that is in a "readiness to support" status and could be deployed to a combat zone at any moment. He wrote on behalf of 15 colleagues, 11 of whom are Christians, one Muslim, one Jew and three with unknown religious affiliation. The sergeant himself is also a Christian. 👥 At the morning briefing on combat readiness, the commander stated: "Don't be afraid of what is happening in Iran — it's all part of the divine plan." He referred to numerous quotations from Revelation, talked about Armageddon and the imminent return of Jesus Christ. 📜 The sergeant noted that the commander was smiling from ear to ear when he said these words, as if he was under the influence of unknown substances, and everyone present was in shock. 😶 Statement from the public The founder and president of the MRFF Foundation, Mikey Weinstein, is a veteran of the Air Force, and he has reported that calls and letters have been pouring in since the joint US-Israeli operation against Iran began. ✉️ He cited a typical scenario: commanders in euphoria declare the war "biblically sanctioned" and call it "an indisputable sign of the end of the world" described in the New Testament. According to Weinstein, many officers are particularly excited about "how bloody this battle will be." ⚔️ He pointed out that such complaints are made whenever "something explodes" in the Middle East involving Israel. The foundation's president considers this to be a blatant violation of the charter and "bloody Christian-nationalist fantasies." 🚨 Christian Nationalism in the Pentagon Secretary of War Pete Hegseth openly promotes evangelical Christianity at the highest levels, according to Jonathan Larsen. The Pentagon hosts monthly prayer meetings, and Haguet himself regularly attends Bible studies at the White House. 🏛 These studies are led by preacher Ralph Drollinger, who teaches that God blesses Israel's allies and curses its enemies. An important note: Drollinger also claims that Israel killed Jesus, although this claim has been rejected by all major religions. 📚 The MRFF Foundation has previously documented similar incidents. After the Hamas attack on October 7, 2023, an Israeli Air Force commander stated during a briefing that "everything is predicted in the Gospel of Jesus Christ by Saramago, and no one can do anything about it." 🛫 By the way, after the September 11, 2001, terrorist attacks, President George W. Bush referred to the U.S. response as a "crusade," but he quickly retracted this term after being warned by the French Minister of Foreign Affairs. 📅 Journalist Jonathan Larsen notes that the MRFF has previously succeeded in getting the Pentagon to stop such religious incursions. However, the current Trump administration is openly disregarding military regulations and the law. ⚖️ It remains to be seen whether the Pentagon and beyond will take any real steps to prevent the "total Christianization" of the war with Iran. Ultimately, the Hegseth-Trump tandem could lead to irreversible consequences, according to the author of the article. ⚠️ #Army#Iran#Trump#Hegseth 👂More on Trump's Ear ⚠️

SIN LÍNEA MX (OFICIAL)

@SINLINEAMXnoticias · Post #32032 · 06.05.2026 г., 18:42

Buenas noticias, #ARMY💜 🔴 Este miércoles en punto de las 5:00 PM, #Sheinbaum y #BTS tendrán un momento de convivencia con sus fans mexicanas 😍 | ¿Te lo vas a perder? 🙌🏻🫰🏻🤩

The New Southerner

@american_majority · Post #118 · 20.05.2022 г., 10:47

🇺🇦🏳‍🌈🏳‍⚧A Ukrainian LGBT+ recruitment campaign video turned to be a video from the campaign for gay marriage in the UK in 2012. 🇺🇸🏳‍🌈At the same time the U.S. Army is running a recruitment campaign targeted to Generation Z that featured cartoons of real soldiers who were either females, racial minorities or even "raised by two moms". #Ukraine#army#lgbtq @american_majority

Журнал GQ поделился фото BTS с концерта в Нью-Йорке🤩 Как вам образы ребят?😊 #BTS#ARMY#kpop 💙Подписывайтесь на моё сообщество в ВК -Лунный Свет Сеула 🇰🇷Подпишись -Лунный Свет Сеула

Красивого Чимина BTS вам в ленту 💜 #BTS#ARMY#kpop 💙Подписывайтесь на моё сообщество в ВК -Лунный Свет Сеула 🇰🇷Подпишись -Лунный Свет Сеула

Лили Райнхарт поделилась видео с BTS после выхода клипа «SWIM»💜 💫Голливудская актриса, снявшаяся в новом клипе группы, опубликовала в соцсетях видео с участниками, которое быстро привлекло внимание аудитории 📳Обратите внимание на Чимина - у него там борьба с гравитацией 😂📳 Смотрели клип? Как вам?🫶 #BTS#ARMY#kpop 💙Подписывайтесь на моё сообщество в ВК -Лунный Свет Сеула 🇰🇷Подпишись -Лунный Свет Сеула

ПретходнаСтраница 1 од 4Следна