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

Резултати

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

Пребарај: #tonup

当前筛选 #tonup清除筛选
TonOrbital

@tonorbital · Post #287 · 03.07.2024 г., 06:22

🚀$BOOM IDO on #TonUP Confirmed! 🎮BOOM UP: The first MiniApp on The Open Network with construction, social interaction, and profitability. Enjoy mobile gameplay with assets secured on TON blockchain. 💎 IDO Rounds: • Community Round: July 11th, 10:00 AM - 12:00 PM UTC. Exclusive for active community members. • UPer Round: July 11th, 12:00 PM - July 12th, 12:00 PM UTC. Open to $UP token holders. Hold and stake $UP for rewards and allocation. The $BOOM IDO price details and single whitelist participation amounts will be gradually revealed. 🤔 What is TonUP?

Hashtags

TonOrbital

@tonorbital · Post #275 · 01.07.2024 г., 18:29

🚀 Big News from #TonUP! The Upgraded UPbassador Program has just launched! This initiative is a testament to TonUP's deep appreciation for the dedication and passion of its community builders. If you share their vision for the evolving #TON ecosystem, now is the perfect time to join their mission. 💎 Key Enhancements: • Enhanced rewards with $UP tokens and exclusive early access rights. • New roles and tracks for those interested in contributing to TonUP. • Improved support and resources to ensure your success. 🔗 Ready to make a lasting impact? Join the UPbassador Program 🤔 What is TonUP?

Hashtags

BYIN Channel

@byinchan · Post #63 · 19.08.2024 г., 15:46

Dear BYINLords, Big News is coming! 🚀 The $BYIN IDO is now confirmed for August 26th on #TonUP, the leading launchpad of #TON! The $BYIN IDO will be offering three rounds this time: 1⃣️ August 26th UTC 10:00 AM - 11:00 AM, KOL & Community Round: This exclusive round is reserved for active community members and key opinion leaders. Stay tuned to our social channels for details. 2⃣️ August 26th UTC 11:00 AM - 13:00 PM, UPer Round: This round is open only to $UP token holders. To participate, simply hold and stake your $UP to earn token rewards and potential allocation. We will announce the staking details soon. 3⃣️ August 26th UTC 13:00 PM - August 27th UTC 13:00 PM, Public Round: This round is open to all users with limited allocation. The $BYIN IDO price details and participation amounts will be gradually revealed. 🔗 For more IDO details, please visit: https://tonup.io/project/BYIN https://x.com/TonUP_io/status/1825558366082732165 👀 Stay tuned for more upcoming big news!

Hashtags

🔥 As the leading launchpad on the TON blockchain, #TonUP is pleased to disclose changes to the revenue distribution model for the platform's revenue. Going forward, all the platform revenue generated from IDO service fees will be allocated as follows: ⚫️ 25% will be used to provide #IDO tokens to the Launchpool program for the benefit of $UP token holders. ⚫️ 50% will be earmarked for $UP token buyback and burns, reducing the overall circulating supply of $UP. ⚫️ 25% directed towards supporting the #TonUP team It's important to note that future IDO participants will no longer receive $UP tokens as a reward. 🔗 To maintain transparency, TonUP will regularly update the community on buyback and burn details on this page. 🔥 All transactions from the tonup-buyback.ton wallet will also be publicly disclosed. ❤️ This new model is designed to better align incentives and provide greater value to our holders. The TonUP team looks forward to sharing more updates soon.

Hashtags

TonOrbital

@tonorbital · Post #367 · 15.07.2024 г., 11:33

🚀 BOOM UP Successfully Concludes IDO on #TonUP! 📅 Claim Your $BOOM Tokens: Date: July 15th Time: 03:00 AM UTC 💙 Exciting News! $BOOM will be listed on Bitget, a leading global cryptocurrency exchange, fulfilling their #CPP commitment. 🔵 Initial Listing Details: Trading Pair: BOOM/USDT Deposit: Now Open Trading Starts: July 15 at 12:00 PM UTC 🤔 What is TonUP?

Hashtags

🚀 The $BYIN IDO is now confirmed for August 26th on #TonUP! 🎮@BYINchann is a gateway to effortlessly creating and trading memecoins on #TON. It offers features like easy token creation, on-platform fundraising, dynamic pricing, and seamless #DEX integration. The platform also provides Telegram-based tools like reminders, trending alerts, and management bots. The $BYIN IDO will be offering three rounds this time: 1️⃣August 26th UTC 10:00 AM - 11:00 AM, KOL & Community Round: This exclusive round is reserved for active community members and key opinion leaders. Stay tuned to the social channels for details. 2️⃣August 26th UTC 11:00 AM - 13:00 PM, UPer Round: This round is open only to $UP token holders. To participate, simply hold and stake your $UP to earn token rewards and potential allocation. Staking details will be announced soon. 3️⃣August 26th UTC 13:00 PM - August 27th UTC 13:00 PM, Public Round: This round is open to all users with limited allocation. The $BYIN #IDO price details and participation amounts will be gradually revealed. 🫥For more IDO details, please visit: tonup.io/project/BYIN 🫥 For more project info, please check: community.tonup.io/t/all-you-need-to-know-about-byin-ido 💎 The BYIN IDO is committed as part of the #TonUP CPP program, offering a comprehensive refund policy if the $BYIN token price dips below the IDO price. So don't miss out on this chance with a full promise of protection! We will give 1 WL's to KOL & Community Round to the one who left more 🌟 Stars under this post TonUP | Chat | Blog | X | Website

BYIN Channel

@byinchan · Post #75 · 23.08.2024 г., 08:57

🎊SnakeLite x TonUP x BYIN 🚀 $BYIN IDO will go live on AUG 26th on #TonUP! 💎 $BYIN IDO on TonUP is under Community Protection Plan (CPP), with Refund Policy, Liquidity Supervision and Price Protection. 🎁2✖️WL for Community Round of #BYIN IDO #Giveaway 🔥Participate NOW https://x.com/snakeliteio/status/1826869554343182645 ⏰12H ✅Join https://t.me/BYIN_official_bot ✅Join https://t.me/Snakelite_official_bot WL holders can participate in KOLs & Community Round of BYIN IDO on TonUP directly, and no need to stake $UP (the token of TonUP) before IDO. Details about IDO WL: https://bit.ly/3X9oMl9 Details about IDO CPP: https://bit.ly/3yNmQFs

The Highly Anticipated $BOOM IDO on TonUP is now CONFIRMED!✔️ 👾BOOM UP is the first lightweight Mini App integrated with construction, social interaction, and strong profitability, all built on The Open Network. It allows players to experience the joy of play on their mobile devices, with assets secured on the #TON blockchain. 💎 The #BOOM#UP#IDO is an integral part of the #TonUP CPP program, offering a comprehensive refund policy if the $BOOM token price dips below the IDO price. For the IDO will be offered two rounds with new mode: 💎Community Round:July 11th, 10:00 — 00:00 UTC This exclusive round is reserved for our active community members and key opinion leaders. Stay tuned to the official social channels for details on how to earn a spot. 💎UPer Round: July 12th, 00:00 — July 13th, 00:00 UTC This round is open only to $UP token holders. To participate, simply hold and stake your $UP to earn token rewards and potential allocation. TonUP will announce the staking details soon. The $BOOM IDO price details and single whitelist participation amounts will be gradually revealed. 🔗For more IDO detailed information, check this 🎓For more project info and updates, check this Announcement | Chat | Website