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

Резултати

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

Пребарај: #antarctica

当前筛选 #antarctica清除筛选
Russian MFA 🇷🇺

@MFARUSSIA · Post #28162 · 29.01.2026 г., 16:00

🧭January 29 marks theDiscoverers’ Day in Russia 🧊 On this day in 1820, Russian naval officers Faddey Bellingshausen and Mikhail Lazarev discovered #Antarctica – the sixth continent. The expedition lasted 751 days. Sailing aboard the two sloops Vostok and Mirny, the 102-strong crew were the first to map the boundaries of the Antarctic continent. The voyage was extremely arduous and dangerous. Small wooden sailing vessels had to navigate close to ice and icebergs, often in dense fog. Heading south, on January 28, the Russian navigators came within close proximity of the icy shores of a previously unknown land. 📝Mikhail Lazarev later wrote about that historic moment: “We reached latitude 69°23 S, where we met main ice of extraordinary height… and looking out from the crosstrees, it stretched just as far as our gaze could reach… At last, there lay before us that southern main, so long sought after, whose existence scholars in their studies had deemed necessary for the balance of the globe.” Braving fierce ocean swells and polar ice, the expedition successfully circumnavigated the continent. This remarkable voyage brought glory to Russia and turned St Petersburg into a leading centre of global geography. The results of the expedition, which led to the discovery of Antarctica and twenty-nine new islands, represent an Russia's outstanding contribution to the history of geographical exploration. Later, shortly after the end of the Great Patriotic War, the Soviet Union resumed its exploration of the continent. In 1946, the Slava whaling flotilla, carrying a scientific team, sailed to Antarctica. They reached the point where Bellingshausen and Lazarev had sighted the “main ice” and verified the accuracy of their original accounts. On February 13, 1956, the first Soviet Antarctic research station, the Mirny Observatory, was officially opened. This was later followed by a network of year-round Russian stations. 🇷🇺 Today, Russia continues its research in Antarctica. In late 2024, a new wintering complex entered service at the inland Vostok Station. In 2025, the research vessel Akademik Tryoshnikov completed the International Antarctic Coastal Circumnavigation Expedition. The 71st Russian Antarctic Expedition is currently underway.

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1035 · 23.07.2024 г., 12:14

Antarctica🇦🇶 An eco-camp inspired by the space exploration era, providing exclusive access to the most remote locations on the continent. Equipped with six heated pod rooms featuring floor-to-ceiling panoramic windows. #Antarctica @voyage

Hashtags

RTDocumentary

@rtdocumentary · Post #265 · 15.10.2021 г., 10:00

No man’s land #video#Antarctica It’s open to everybody and no country owns it. People and wildlife coexist here peacefully. What’s this wonderful place? It’s Antarctica, the world’s coldest and most pristine continent! On this day, exactly 62 years ago, a conference in Washington DC paved the way for the Antarctic Treaty, which proclaims that the world's southernmost continent should be free of weapons, borders, and exploitation. Only science and collaboration are welcome here. To honour that date, here are some interesting facts. ❄️ You can’t take anything out of the continent, including stones, feathers, or anything manmade. ❄️ Antarctica has the lowest recorded temperature on earth, -89.2 degrees Celsius. ❄️ America’s McMurdo station is the largest research station here, with over 1,000 scientists working throughout the year. Follow: https://t.me/rtdocumentary

📱Play Market +

@pm_plus · Post #33962 · 15.04.2026 г., 08:11

Antarctica 88 🆕Обновление Вы попадётев Антарктиду, где сможете окунуться в жуткую научно-фантастическую историю. Готовы ли вы к встрече с ужасными существами, которых скрывает Антарктида? ⚙️Полная купленная Pro версия (299₽). Мод меню: разблокирован весь платный контент и другое. #Хорроры #Хорроры@pm_plus #Antarctica@pm_plus 📱Play Market + ⚡️ НАШ ЧАТ

Interesting Planet 🌍

@interesting_planet_facts · Post #1149 · 21.12.2025 г., 12:11

🌎 Antarctic icefish stand out for surviving in freezing waters thanks to "antifreeze proteins" in their blood. These proteins prevent ice crystals from forming inside their bodies, letting them live where most fish would freeze solid. Some species have completely lost red blood cells and hemoglobin. ✨ #adaptation⚡#animals⚡#antarctica 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #368 · 20.07.2025 г., 18:22

🌎 The deepest point on land is the Bentley Subglacial Trench in Antarctica, buried beneath almost 3 kilometers of ice. This hidden valley lies 2,555 meters below sea level, far deeper than Death Valley, and remains inaccessible except through advanced radar technology. ✨ #Antarctica⚡#geology⚡#extremes 👉subscribe Interesting Planet

Amazing Geography 🌍

@amazingeo · Post #121 · 26.08.2025 г., 16:12

🌍 Mount Erebus in Antarctica is one of the world’s southernmost active volcanoes. Its lava lake stays liquid year-round, despite harsh temperatures that often plunge far below freezing. ✨ #volcanoes⚡#Antarctica⚡#mountains⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #462 · 18.11.2025 г., 20:31

🌍 Antarctica is the only continent entirely surrounded by ocean and is nearly twice the size of Australia. Its thick ice reflects sunlight, helping regulate Earth’s overall temperature. ✨ #continents⚡#oceans⚡#Antarctica⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1287 · 11.02.2026 г., 22:11

🌎 Beneath the Ross Ice Shelf in Antarctica, researchers discovered a thriving community of tiny amphipod crustaceans living over 500 meters below the ice. Scientists accessed this hidden ecosystem in 2015 by drilling through the thick ice, revealing life where sunlight never reaches. This shelf covers an area roughly the size of France. ✨ #ocean⚡#Antarctica⚡#crustaceans 👉subscribe Interesting Planet 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #699 · 23.04.2026 г., 20:31

🌍 Antarctica is home to “blue ice” areas where strong winds strip away snow and expose centuries-old glacier ice, creating shimmering fields that reflect nearly as much sunlight as fresh snow. ✨ #glaciers⚡#Antarctica⚡#polar⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

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