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

Резултати

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

Пребарај: #blockchainlife2025

当前筛选 #blockchainlife2025清除筛选

Storm Tradeis in the final of Blockchain Life Awards 2025🏆 Since 2023, the Storm team has gone from an idea on paper to one of the leaders in DeFi 🥇 TON. ✅ From scratch to the top in TVL.🏅 ✅ From MVP to the fastest trading in the ecosystem. ✅ And all this — together with you. 🥇 Today, Storm Trade is nominated in the category "Best Decentralized Exchange for CIS Users". And now it's up to the community. It's easy to support Storm: ✔️ Go to the website: voting.blockchain.forum/en ✔️ Log in via Telegram ✔️ Find the category "DEX for CIS users" ✔️ Vote for Storm Trade 🫶 This is not just an award. This is recognition from the community. Let everyone's voice become a contribution to the development of the project that we are building together. Your voice matters!🐸Vote for Storm Trade! ✅ #StormTrade#BlockchainLife2025

The future 🤑Bitcoin ATH was revealed in this video 📹youtube.com/watch?v=oG9tefwj1Uo Watch it now! 🔥 Altseason is coming just like your favorite crypto conference, so don’t miss it. Get ready for new ATH 🚀 🎟Get your ticket with a -10% discount via promo code TONEVENTS #BlockchainLife2025#Dubai#Web3

Blockchain Life is approaching! 🥳April 23-24, 2025, the long-awaited 14th Blockchain Life Forum will take place in Moscow! 📹Check out the trailer and feel the vibe! 🌐 Over 15,000 participants from 100+ countries! Founders and C-Level of the largest projects in the field of web3, cryptocurrency and mining will share exclusive insights and earning strategies. 🎓 Many of the invited speakers have never performed in Russia before and will bring only the most exclusive information. 🎶Simultaneous translation of all performances is absolutely free! 🤩 The forum will host the 12th award ceremony for industry leaders, Blockchain Life Awards! This means that it will be easier than ever to meet the CEO of a major exchange or the founder of a well-known project right at the exit from the hall. Don't miss your chance for exclusive acquaintances! 🔥Presale is in full swing! PRICES INCREASE TOMORROW! Buy a ticket TODAY with 10% discount using promo codeTONEVENTS #BlockchainLife2025#Moscow

For the first time in a long time, the world's top crypto stars will come to Moscow! 🥳April 23-24, 2025 — don’t miss the long-awaited 14th Blockchain Life Forum! The event will be held under the Blockchain Forum brand. 🌐 Over 15,000 participants from 100+ countries! Founders and C-Level of the largest projects in the field of web3, cryptocurrency and mining will share exclusive insights and earning strategies. 🎓 Many of the invited speakers have never performed in Russia before and will bring only the most exclusive information. 🎶Simultaneous translation of all performances is absolutely free! 🤩 The forum will host the 12th award ceremony for industry leaders , Blockchain Life Awards ! This means that it will be easier than ever to meet the CEO of a major exchange or the founder of a well-known project right at the exit from the hall. Don't miss your chance for exclusive acquaintances! 🛍Presale is in full swing! Tickets are still at a reduced price and an additional 10% discount with the promo codeTONEVENTSon the official website. #BlockchainLife2025#Moscow

Blockchain Life 2025, Dubai | October 28–29 The 15th anniversary edition of Blockchain Life is set to become the largest crypto event of the year for those building careers and businesses in the Web3 space. With over 15,000 attendees expected, the forum will feature three content stages and a vibrant open-air program. Five reasons to get this on your schedule.: 1️⃣Positioning for the next market phase. Industry experts will share growth scenarios and actionable steps to help you make the most of the upcoming cycle. 2️⃣First-hand tech trends. Industry leaders will present innovations that could go mainstream within months. Simultaneous translation into Russian will be available. 3️⃣Global networking. With representatives from funds, exchanges, and infrastructure projects, the event is a powerful platform for partnerships, investment, and career opportunities. 4️⃣Expanded program. In addition to the main forum, expect themed meetups, yacht tours, and exclusive evening events. 5️⃣Atmospheric AfterParty. As tradition goes, the organizers will bring in top international performers — the lineup will be announced closer to the date. 🎟Get your ticket with a 10% discount here using promo code TONEVENTS 🚬See you in Dubai! #BlockchainLife2025#Dubai#CryptoConference#Web3#CryptoNews

Blockchain Life 2025, Dubai | October 28–29 The 15th anniversary edition of Blockchain Life is set to become the largest crypto event of the year for those building careers and businesses in the Web3 space. With over 15,000 attendees expected, the forum will feature three content stages and a vibrant open-air program. Five reasons to get this on your schedule.: 1️⃣Positioning for the next market phase. Industry experts will share growth scenarios and actionable steps to help you make the most of the upcoming cycle. 2️⃣First-hand tech trends. Industry leaders will present innovations that could go mainstream within months. Simultaneous translation into Russian will be available. 3️⃣Global networking. With representatives from funds, exchanges, and infrastructure projects, the event is a powerful platform for partnerships, investment, and career opportunities. 4️⃣Expanded program. In addition to the main forum, expect themed meetups, yacht tours, and exclusive evening events. 5️⃣Atmospheric AfterParty. As tradition goes, the organizers will bring in top international performers — the lineup will be announced closer to the date. 🎟Get your ticket with a 10% discount here using promo code TONEVENTS 🚬See you in Dubai! #BlockchainLife2025#Dubai#CryptoConference#Web3#CryptoNews

iGlobal Community

@iGlobalCom · Post #1240 · 22.07.2025 г., 14:02

#партнерскийпост ⚡️28 Вт и 29 Ср октября 2025 — юбилейный 15-й Blockchain Life 2025 в Дубае – ТОП причин быть: 1️⃣ 15 000+ участников, мощный нетворкинг с инсайтами, которые не найти в Telegram 2️⃣ Буллран и альтсезон уже близко — ты узнаешь что сделать, чтобы заработать максимум 3️⃣ О трендах, которые станут мейнстримом через полгода, расскажут главные фигуры крипты с синхронным переводом на русский язык 4️⃣Самый большой форум в истории – 3 сцены, международный нетворкинг и огромная уличная зона с активностями 5️⃣ легендарная AfterParty: пока непонятно, кого привезут выступать в этот раз, но среди артистов уже были Тимати, Алан Уолкер и Френч Монтана; мб Канье Уэст? 6️⃣ Не просто форум — целая Blockchain Life Week: яхты, митапы, вечеринки, нетворкинг 🎟 10% OFF для участников ⚡️@iGlobalChat по промокоду iGlobalBlockchain25 на официальном сайте blockchain-life.com #BlockchainLife2025#Dubai#Crypto#Web3#биткоин#альткоины#крипто#блокчейн#Bullrun2025#Altseason#CryptoGems#CryptoAlpha#CryptoWhale#AlphaLeak#инсайды