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

Резултати

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

Пребарај: #airdropcomic

当前筛选 #airdropcomic清除筛选
Airdrop Comic

@airdropcomic · Post #1971 · 07.05.2025 г., 17:11

🚀 Space and Time (SXT) Airdrop is LIVE on Binance! 🎉 Earn FREE $SXT with Binance Launchpool! If you lock BNB, FDUSD, or USDC (8th May - 7th June 2025), you may qualify 🎁 🔥Why Space and Time? ✔️ Redefining on-chain data with ZK-proven tech 🔍 ✔️ Microsoft-backed project with innovative solutions 💡 ✔️ Trusted by top investors in the blockchain space 🚀 📈$SXT Trading Pairs on Binance: 🔹 SXT/USDT | SXT/USDC | SXT/BNB | SXT/FDUSD ⚙️How to Participate? 👉See SXT Airdrop Info on Binance 📢Stay Updated & Join Our Community: 🔗 Follow us on Twitter: @SpaceandTimeDB ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens #SpaceAndTime#SXT#Binance#Launchpool#Crypto#AirdropComic

Airdrop Comic

@airdropcomic · Post #2068 · 24.07.2025 г., 08:26

🔥Xyber Early Access Airdrop – Join The Collective ✅ 💠Join Xyber and be part of the first full-stack OS for on-chain AI agents & verifiable intelligence. ☀️Airdrop Link: https://join.xyber.inc ⚙️How to Claim? ♦️ Connect your new wallet ♦️ Submit your email address ♦️ Bind your X (Twitter) account & Discord ♦️ Follow Xyber on X ♦️ Complete all steps you’re Done 📌 Xyber is building an AI-focused decentralized OS to launch ownable AI agents that transact and operate on-chain – fully transparent and no backend control. 🌍Powered by cutting-edge Web3 innovation 📆 Early Access Open Now ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens required #Xyber#AIonChain#Web3OS#Airdropcomic

Airdrop Comic

@airdropcomic · Post #2061 · 14.07.2025 г., 06:25

🔥Airdrop - Bluefin x OKX Cryptopedia ✅ 💰Total Reward: $605,000+ worth of tokens — including $550K in BLUE + $55K in SUI — up for grabs through Cryptopedia Season 38 ☀️Airdrop Link :- Click Here ⚙️How to Participate? ♦️Connect your OKX Wallet (SUI Network) ♦️Complete all tasks within the Bluefin campaign on Cryptopedia ♦️Verify your actions to be eligible ♦️Tasks are simple and interactive — don’t miss out 🎁Eligible participants will earn a share of 605,000 USDT in token rewards 📆Campaign Ends: 6 September 2025 – 7:00 AM UTC 📌Explore DApps, complete missions, and earn rewards this is Web3 made fun and rewarding 🔗 Source: https://x.com/wallet/status/1943597905996034069 ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens required #OKX#Bluefin#Cryptopedia#Airdropcomic#Web3Rewards

Airdrop Comic

@airdropcomic · Post #2087 · 06.08.2025 г., 03:20

🔥Airdrop – Endless Protocol ✅ 💠Reward: Claim yourEndless Genesis Role & unlock early-bird perks. Become one of the founding architects of the decentralized AI cloud ☀️ Airdrop Link :-Click Here ⚙️How to Participate? ♦️Register – Fill the form & submit your details ♦️Claim Role – Secure your Endless Genesis Role instantly ♦️Early-bird Benefits – Enjoy special perks for joining early ♦️Be a Builder – Contribute as an architect of the AI-powered cloud 🌐Website: https://endlessprotocol.ai 📌Tip: The earlier you join, the more exclusive your role and benefits will be. ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens. #EndlessProtocol#Airdropcomic#AICloud#Web3#GenesisRole

Airdrop Comic

@airdropcomic · Post #1988 · 17.05.2025 г., 04:00

🚀Nexpace (NXPC) Airdrop is LIVE on Binance EARN FREE $NXPC WITH BINANCE HODLER AIRDROPS If you subscribed to BNB Simple Earn (Flexible and/or Locked) on Chain Yields products from 6th May - 15th May 2025, you may qualify! 🎁 🔥 What Makes Nexpace Unique? ✔️ Protocol to power next-gen reward experience ✔️ Trusted by Binance for HODLer Airdrops ✔️ Spot Accounts must hold at least 1 NXPC 💰$NXPC Trading Pairs on Binance: NXPC/USDT | NXPC/USDC | NXPC/BNB | NXPC/FDUSD | NXPC/TRY ⚙️How to Participate? 👉See NXPC Airdrop Info on Binance 📢 Stay Updated & Join Our Community: 🔗Follow us on Twitter: @NexpaceOfficial ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens #Nexpace#NXPC#Binance#HODLERAirdrops#Crypto#AirdropComic

Airdrop Comic

@airdropcomic · Post #2150 · 18.10.2025 г., 10:48

🚀Euler (EUL) Airdrop is LIVE on Binance EARN FREE $EUL WITH BINANCE HODLER AIRDROPS If you subscribed to BNB Simple Earn (Flexible and/or Locked) or On-Chain Yields products from 4th Oct - 6th Oct 2025, you may qualify 🎁 🔥What Makes Euler Unique? ✔️ DeFi protocol for lending and borrowing crypto assets ✔️ Supports BNB Smart Chain, Ethereum, Base & Arbitrum networks ✔️ Featured as the 51st project under Binance HODLer Airdrops 💰$EUL Trading Pairs on Binance: EUL/USDT | EUL/USDC | EUL/BNB | EUL/FDUSD | EUL/TRY ⚙️How to Participate? 👉See EUL Airdrop Info on Binance: 🔗https://www.binance.com/en/support/announcement/detail/7d38f20e2d1e456dba84352d9284699e 📢Stay Updated & Join Our Community: 🔗Follow us on Twitter: @Binance | @EulerFinance ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens #Euler#EUL#Binance#HODLERAirdrops#Crypto#DeFi#AirdropComic

Airdrop Comic

@airdropcomic · Post #2069 · 25.07.2025 г., 05:08

🔥Airdrop – XpunkLabs (XPUNK Token) ✅ 💠Reward:Get 100 XPUNK tokens absolutely free (worth ~$10) just by completing simple tasks ☀️Airdrop Link :- Click Here ⚙️How to Join? ♦️Follow theirTwitter Account ♦️Join theirTelegram Channel ♦️Submit your Metamask wallet ♦️For 500Random Lucky Winners ♦️Top 100 referrers get extra XPUNK tokens 🌐Website: https://xpunklabs.com 📈Listed on:MEXC, Coingecko 📅 Distribution: August 31st ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens required #XpunkLabs#XPUNK#Airdropcomic#CryptoAirdrop#MEXC

Airdrop Comic

@airdropcomic · Post #2089 · 07.08.2025 г., 12:33

🔥Airdrop – Empeiria x Leap Wallet ✅ 💠Reward:Empe Micro Node (worth $50) – Grants access to EMPE token staking rewards. Claiming starts after TGE. ☀️Airdrop Link :- Click Here ⚙️How to Participate? ♦️Jointheevent on Galxe ♦️Complete all listed quests ♦️Connect your wallet & verify tasks ♦️Secure yourEmpe Micro Node reward 📌Note:Limited-time event – don’t miss your chance to get early staking access with Empeiria ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens. #Empeiria#LeapWallet#Galxe#Airdropcomic#CryptoRewards#Web3

Airdrop Comic

@airdropcomic · Post #2060 · 11.07.2025 г., 12:26

🔥Profile Launch - Ronin Profile (LIVE) ✅ 💠Ronin has officially launched its Web3 Onchain Identity system — allowing users to create and manage their own profile with multi-wallet support. ☀️Profile Link :- Click Here ⚙️ How to Participate? ♦️Sign in with your Ronin Wallet (Keyless) ♦️Set up your profile and personalize your details ♦️Bind your social accounts for visibility ♦️Do daily check-ins to stay active ♦️Link up to 6 wallet addresses in one profile 🧩Early version available now — new features coming soon 🔐A keyless wallet is required to access your Ronin Profile 🔗 Source:https://x.com/Ronin_Network/status/1943245375638507811 ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens required #RoninProfile#Ronin#Web3Identity#CryptoTools#Airdropcomic

Airdrop Comic

@airdropcomic · Post #2066 · 19.07.2025 г., 06:18

🔥Airdrop – StarGlow (Guaranteed)✅ 💰Reward:2 USDT for eligible participants + extra bonuses for top referrers ☀️Airdrop Link :- Click Here ⚙️How to Participate ? ♦️Join the StarGlow Airdrop Bot on Telegram ♦️Follow & Retweet the official StarGlow post on Twitter (X) ♦️Submit your BSC wallet address ♦️Complete all tasks to confirm your entry 📋Eligibility & Rewards 🔹400 random winners will receive 2 USDT each 🔹Top 100 referrers will get additional USDT bonuses 🔹 Participants in TGE will receive confirmed SGP tokens + NFT rewards 🌐 Website:https://starglow.io 🗓 Airdrop ends: 15 August 2025 📦Distribution date: 22 August 2025 ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens required #StarGlow#GuaranteedAirdrop#USDTReward#SGPToken#Airdropcomic

Airdrop Comic

@airdropcomic · Post #2065 · 17.07.2025 г., 08:52

🔥Free Mint – Heartscape NFT on Monad ✅ 💠Claim your dreamy, emotion-filled Heartscape NFT for FREE on the Monad Network – a cascade of violet vibes & floating hearts awaits ☀️Mint Link :- Click Here ⚙️How to Mint ? ♦️Like & Retweet Morkie’sPost on X ♦️Join the Morkie Discord account ♦️Check your Web3 ID ♦️Mint your NFT on the website 🖼Heartscape is an ethereal, emotional NFT that captures deep feelings through beautiful art, violet hues, and floating heart visuals. 💎A must-have collectible for NFT lovers and emotional art fans 📌Limited-time mint – don't miss the magic ®Note - Please do your own research (DYOR) before joining to any airdrops project, also airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens required #MonadNFT#Heartscape#FreeMint#Airdropcomic#NFTdrop#CryptoArt