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

Резултати

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

Пребарај: #anthropology

当前筛选 #anthropology清除筛选

On 'big-game hunters' What if I tell you that one man formulated the whole of the folklore tradition of Stone Age big-game hunters -- hunting magic, initiation ceremonies, dancing shamans, pregnant horses, nubile naked women -- and even an art-historical development of imagery? Your entire perception of the Paleolithic and Neolithic was defined by Abbé Breuil🔗, a Catholic priest in the early 20th century. Of course, this -- reconstructing prehistory on the basis of contemporary behavior and thinking -- is exactly what should NOT be done. But Breuil did it. The idea of "initiation ceremonies" was derived from one set of small heel prints, supposedly of children, in one alcove in one cave. This is the sort of single data point through which any number of lines could be graphed. It begged to be equated with initiation rites of contemporary primitives by anthropologists. Overall there needs to be a re-evaluation of data, considering the developing consciousness of man. #anthropology @EuropeanTribalism

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #39983 · 31.10.2025 г., 01:35

Anthropologist Madhumala Chattopadhyay, took part in the only successful, nonviolent expeditions to the Sentinel Islands, this is extremely rare given the islands’ usual hostility to outsiders. She was the only woman to go along on such expeditions, where all other expeditions failed. Contacting them is illegal, the community must be left alone. For their safety. [Read for yourself here] @googlefactss#anthropology#sentinel

Interesting Planet 🌍

@interesting_planet_facts · Post #1389 · 30.04.2026 г., 22:11

🌎 The San people of southern Africa tell legends of the /Kaggen, a trickster deity that often takes the form of a praying mantis. These stories, documented by 19th-century ethnographers, reflect the San’s deep connection to animals and the land. There are over 450 recorded San myths collected in the Bleek and Lloyd archive. ✨ #mythology⚡#Africa⚡#anthropology 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #971 · 27.10.2025 г., 18:11

🌎 In Madagascar, the turning of the bones ceremony, or Famadihana, sees families exhume ancestors, rewrap the remains in fresh cloth, and dance with the bodies to live music. This ritual, held every seven years, honors lineage and strengthens family bonds. ✨ #traditions⚡#anthropology⚡#Madagascar 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #937 · 19.10.2025 г., 22:11

🌎 For centuries, residents of Whittlesea, South Africa, have participated in the Intonjane ritual—a traditional female initiation ceremony. Young women undergo seclusion, teachings about adulthood, and symbolic rituals marking the transition to womanhood. Anthropologists report Intonjane is practiced mainly among Xhosa communities and usually lasts about a week. ✨ #culture⚡#traditions⚡#anthropology 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1377 · 18.04.2026 г., 12:11

🌎 In Papua New Guinea, the Korowai people still build treehouses perched up to 35 meters above ground. This tradition began as a way to avoid floods, wild animals, and rival clans. Some Korowai treehouses even have separate “guest” platforms for visitors or ritual gatherings. ✨ #anthropology⚡#traditions⚡#rituals 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #902 · 13.10.2025 г., 15:11

🌎 In Vanuatu, the Naghol or "land diving" ritual involves men jumping from tall wooden towers with vines tied to their ankles. This dangerous tradition, practiced on Pentecost Island, is meant to ensure a good yam harvest. Some platforms are over 20 meters high, and proper vine length is crucial to prevent injury. ✨ #traditions⚡#anthropology⚡#rituals 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #869 · 06.10.2025 г., 20:11

🌎 In Indonesia’s Tana Toraja region, families celebrate Ma’nene, a ritual where they exhume deceased relatives, clean their bodies, and dress them in fresh clothes. This custom honors ancestors and reinforces family ties. Some mummies are carried through the village during the ceremony, which happens every few years. ✨ #tradition⚡#anthropology⚡#festival 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1049 · 18.11.2025 г., 12:11

🌎 In Papua New Guinea, the Kaningara people of the Sepik River region perform a crocodile-scarification ritual. Teenage boys undergo elaborate skin-cutting ceremonies that create raised scars resembling crocodile scales, symbolizing a spiritual connection with the river’s sacred crocodiles. The process involves hundreds of cuts and can last several hours. ✨ #ritual⚡#anthropology⚡#tradition 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #854 · 03.10.2025 г., 20:11

🌎 In the folklore of the Ainu people from Japan's Hokkaido region, the kamuy are powerful spirits thought to control natural forces like weather and animals. Early ethnographers documented dozens of distinct kamuy, each responsible for maintaining harmony between humans and the environment. ✨ #mythology⚡#cultures⚡#anthropology 👉subscribe Interesting Planet 👉more Channels ​

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40003 · 03.11.2025 г., 07:00

Igbo‑Ora, Nigeria — nicknamed the 'Twin Capital' — reports twin birth rates around 4–5% (~40–50 per 1,000), far above the global average (~1–1.5% or 10–15 per 1,000). Nearby Yoruba communities and parts of Benin show similar rates. (Figures approximate.)" @googlefactss#Nigeria#anthropology#twins

Interesting Planet 🌍

@interesting_planet_facts · Post #1259 · 28.01.2026 г., 22:11

🌎 In the Indonesian village of Trunyan, the dead are laid out on the ground and covered with bamboo cages instead of being buried. The local Taru Menyan tree releases a natural fragrance that masks odors, allowing bodies to decompose above ground without attracting scavengers. ✨ #rituals⚡#anthropology⚡#Indonesia 👉subscribe Interesting Planet 👉more Channels ​

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