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 слични објави

Пребарај: #telegramminiapps

当前筛选 #telegramminiapps清除筛选

Mini App Shortcuts📣 Now you can now place direct shortcuts to specific mini apps on the home screen of your device. Choose your favorite apps: ❤️CapsGame 🍅Tomarket 🍦Vanilla Finance 🙏STON.fi 💸DeDust ⚡️Storm Trade 😇EVAA 🔥Roolz 🪙Blum 😸Catizen ⚖Nomis 💳HOT wallet ⚡️Electra 🪙Bombie 🚀xRocket Note in comments what other apps you will add! #TelegramMiniApps#TON

The Open Platform

@topco · Post #94 · 18.09.2024 г., 09:59

Web3 Traffic Shift: Integrating & Monetizing Users on Web2 Platforms Initially driven by ideals of full decentralization, privacy, and disrupting traditional systems, Web3 has struggled to provide practical, user-friendly applications that meet mainstream needs. This lack of a unified, compelling narrative for mass adoption has resulted in stagnation in user growth and insufficient liquidity within the ecosystems. The market now demands more accessible, user-centric models that integrate seamlessly with familiar Web2 environments like Telegram to drive broader adoption and engagement. One way to address this stagnation is by facilitating a traffic shift from Web2 to Web3. Telegram is uniquely positioned to meet this challenge. Unlike most platforms, Telegram combines traditional social features with integrated blockchain capabilities, such as wallets and Mini Apps, allowing users to engage with Web3 without leaving the app. This blend of Web2 familiarity and Web3 functionality lowers entry barriers, making it easier for users to explore, adopt, and interact with decentralized applications. To understand the current challenges in user growth and the importance of seamless integration with Web2 environments like Telegram, as well as to explore new monetization models and traffic acquisition strategies in Web3, read our new article: Web3 Traffic Shift: Integrating & Monetizing Users on Web2 Platforms. This report is a collaboration with Samuel QIN (@Samuel_Q6). #TON#Telegram#TelegramMiniApps 📰Medium🔝Kirill from TOP 💼Linkedin✖️ X

DeckForge Announcement

@deckforge_official · Post #361 · 12.12.2025 г., 15:30

🚀 DeckForge Is Now Live in the Telegram App Center DeckForge has officially been listed in the Telegram App Center — marking an important milestone on our journey to becoming a truly global, cross-platform game. Being featured in the App Center gives DeckForge direct access to millions of Telegram users worldwide, seamless onboarding & native distribution inside one of the fastest-growing ecosystems in gaming. This launch is made possible thanks to the support of TON Foundation & our collaboration within the TON ecosystem. 🔵 Easy access directly from Telegram 🔵 Native Mini App experience 🔵 Built for scale, performance & community growth 👀 Very soon, players can expect a series of special in-game events and activations in collaboration with TON partners, including exclusive rewards, themed content & limited-time experiences.. Stay Forged! 🔥 #DeckForge#TON#TelegramMiniApps Join the DeckForge Community: 🌐YouTube𝕏Twitter🎮Discord 👉Chat👉Announcements👉DeckForge

Hamster Games

@hamster_tools · Post #1306 · 17.07.2025 г., 16:05

We’ve launched our Chrome Extension❗ 🔵We’re excited to announce that AppVerse is now available on the 📱 Chrome Web Store 🔵Explore the best ✉️ Telegram Mini Apps in one place - pin your favorites, discover new ones, and stay ahead of the trend. 🔵All just a click away in your browser. Try it now ➡️Extension Link 👍 Thank you for being part of our journey, this is just the beginning! #AppVerse#TelegramMiniApps#ChromeExtension

SingSing Announcement

@singsingchannel · Post #682 · 08.07.2024 г., 04:11

We're thrilled to unveil our latest innovation that's set to revolutionize the Telegram mini-app ecosystem - SingSing SocialFi SDK. 🛠 Our Developer-Friendly SDK brings powerful social and financial features to developers and users alike with: ✅Seamlessly integrate SingSing's features into your Telegram mini-apps ✅Enhance user engagement and monetization opportunities ✅Leverage SingSing club system ✅Use SingSing payment system 🔒 Our SDK is currently being refined with our early partners to ensure a seamless experience. Stay tuned for the public release! Read more and open treasure at: X Post #SingSingSDK#TelegramMiniApps#Web3Gaming#SocialFi

The Open Platform

@topco · Post #88 · 04.07.2024 г., 13:03

Boring A.P.E. (Attention Points Economy): Observations on a New Trend In the digital age, attention has become a valuable commodity, and the "Attention Points Economy" seeks to capture this value by turning simple interactions into measurable points. This concept is gaining traction, particularly in Telegram Mini apps like Notcoin and Hamster Kombat, which engage millions of users through gamified interactions. The economic value created by points rewards every beneficiary within the ecosystem. This creates micro-markets within apps and opens new opportunities for developers and users alike, potentially leading to a decentralized ecosystem where digital engagement and identity merge. Our new post explores the rapid adoption of this trend and its broader significance. #July2024#GameFi#TelegramMiniApps#Telegram#Notcoin

DeckForge Announcement

@deckforge_official · Post #365 · 22.12.2025 г., 08:09

🎄 DeckForge joins the TON Apps Center Advent Calendar! DeckForge is officially featured in the TON Apps Center Advent Calendar — and our quest is already live. What you need to do: Complete the in-game tutorial, master the basics, defeat the bosses — and claim your rewards. 🎟 Earn Tickets today & compete for a $5,000 prize pool: 🔵 $5,000 raffle on December 25 🔵 100 winners × $50 tsUSDe 🎁 Bonus for every participant All players who join the quest will receive a FREE Booster Pack from our brand-new Christmas Collection. 👀 And there’s more ahead Together with our friends & TON Apps Center, we’ve prepared a mega holiday raffle that the entire ecosystem will be watching — packed with exclusive gifts, surprise rewards & moments you don’t want to miss... Stay Forged! 🔥 #DeckForge#TON#TelegramMiniApps#AdventCalendar#giveaway Join the DeckForge Community: 🌐YouTube𝕏Twitter🎮Discord 👉Chat👉Announcements👉DeckForge