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

Резултати

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

Пребарај: #cryptolaunch

当前筛选 #cryptolaunch清除筛选
Crypto Fight || News 🚀

@cryptofightnews · Post #2542 · 28.02.2025 г., 08:00

New hidden Gem 💎 ClownFi 🤡 Ticker: $Clown A trading token that generate profit. Moon is just a matter of time. Airdrop Pool: 5M $CLOWN 💰 Eligibility: ✅ Follow $CLOWN on X b4 5th Mar @clownfitoken ✅ Join Telegram 👉https://t.me/+R_ZoGK8h9501ZDE1 ✅ RT the pinned tweet & comment your BEP20 wallet address 🔒 Available on PancakeSwap 🔗 SC: 0xc5EB040Ad6C58B4a67d5730E3765365676BbcB67 Website: https://sites.google.com/view/clownfi-token/tokenomics Trades tracker: https://docs.google.com/spreadsheets/d/1SU3gRRl960muulkmhqX2QvzWxK12LjoZ-qIgzif4ios/edit?gid=969882748#gid=969882748 Token Vesting: https://app.uncx.network/lockers/token/chain/56/address/0xc5eb040ad6c58b4a67d5730e3765365676bbcb67 LP Lock: https://app.uncx.network/lockers/manage/lockers-v2?service=edit&locker=0xc765bddb93b0d1c1a88282ba0fa6b2d00e3e0c83&pool=0x7ef43Edf277e0c417a57bF3618B7A50365133841&lock=0&index=0&wallet=0x7E6adB88AE7E55f47cA768A5bEc23f7B83f13AD1&chain=56 🕒 Distribution on 19 Mar—no bots, no dumpers 🚫 #CLOWN#CryptoAirdrop#BNB#CryptoLaunch

🚀 OCRO IEO: Built to Rise, Designed to Reward IEOs are changing the game—and Octario Exchange is leading the way with OCRO. Unlike traditional ICOs, the OCRO IEO is hosted directly on the exchange, offering trust, transparency, and real structure. Powered by the Rising Edge Mechanism, OCRO’s price increases across 3 phases: from $0.30 to $0.80, before launching at $1.00. 📈 Each phase = limited supply + higher price 🎯 Early buyers = best value + built-in scarcity OCRO holders also get real utility: low gas fees, access to blockchain games, and real-world asset exposure. Don’t miss this rare chance to join a token economy engineered to grow. 👉 Participate now at 📢 Let’s talk about the Rising Edge Mechanism that makes OCRO unique: 📈 Upward-Only Pricing You can’t sell OCRO for less than your purchase price. Every sale must occur higher than the last. 🔓 Demand-Driven Supply Every buy unlocks more tokens from escrow, fueling circulation only when there is real demand. ⚡️ Momentum Over Volatility Instead of price drops, market activity creates upward pressure. The more people participate, the stronger OCRO becomes. 💠 This makes OCRO the first token designed to rise by design. 👉octario.exchange #OCRO#IEO#CryptoLaunch#OctarioExchange#BuiltToRise

Crypto Fight || News 🚀

@cryptofightnews · Post #2287 · 18.12.2024 г., 19:45

🚨 THE ICO IS NOW LIVE FOR EVERYONE! 🚨 🔥 The Public Phase Has Officially Begun! 🔥 This is your chance to secure $STAY tokens and join the Web3 travel revolution! Don’t miss out on this groundbreaking opportunity. Why $STAY? 🌍 One Price for All – Fair access for every participant. 📈 Top 3 Exchange Listing Soon – Be ready for the next big thing. 💰 Low FDV at 35M USDT – Strong fundamentals for sustainable growth. 🌟 Jeff Hoffman as Lead Advisor – The visionary behind Booking.com. ⚽ Global Football Ambassador – Uniting sports and travel innovation. 🏨 2.5 Million Onboarded Stays – Endless travel possibilities. 🤝 Official Partner: Huawei – Driving innovation together. Why Act Now? 💎 Double Your Tokens Potential – The time to maximize your gains is now! ⏳ Tokens Are Selling Fast – Don’t miss your chance to be part of the future of travel. 🌐 Grab Your $STAY Now: 👉community.staynex.vip 🎁 Participate in Extra $STAY Rewards: 👉reward.staynex.vip 🔽 Learn More: bit.ly/StaynexICO Risk Disclaimer: Investing in cryptocurrencies involves significant risks. Please understand that your funds are your responsibility. Always Do Your Own Research (DYOR) before making investment decisions. #Staynex#ICO#CryptoLaunch#Web3Travel#BlockchainRevolution#Crypto#STAY#Tokenomics

🚀🚀The intelligent investors💯💯

@the_intelligent_investors · Post #1632 · 01.02.2025 г., 08:34

🚀 Blockchain Energy is LIVE! 🔥 The world’s first physical blockchain product is here—introducing Blockchain Energy! 💥 Our website and ICO are officially LIVE, and early buyers can now purchase BET tokens at. www.blockchainenergy.co.uk. 💰 Buy early before prices increase! Price alerts and community updates will be shared exclusively on our Telegram group – join now: https://t.me/+vLcj22SyWvY2ZDg0 🔗 Powering the future of blockchain with real-world energy! #BlockchainEnergy#BETToken#CryptoLaunch#ICO#BlockchainRevolution#CryptoCommunity#Web3#CryptoInvesting#TokenSale#CryptoPresale

⚪️ 🔤 🔤 🔤 🔤 MEGABASE COIN ($MGBS) The Future of Community-Driven Wealth Starts Now 💰Contract Address: 0x481ef7Ff561d9a2a892553ba930A6365f911E0bb MegaBase ($MGBS) is more than a token — it’s a long-term vision built on transparency, innovation, and community empowerment. We are designing a sustainable ecosystem where growth is shared, value is real, and the community always comes first. 🌍✨ 💥 Why MegaBase? Every $MGBS transaction contributes to something bigger than price action — it helps fuel ecosystem growth and real-world impact. 🔥 Core Features 💰 Earn Rewards 🔥 Auto-Burn Mechanism 🎁 Milestone Giveaways 💧 Auto Liquidity 🛡 Progressive Protection Protocol 🔄 Ecosystem Engineered for Continuous Development ❤️ Charity Contributions Selected by the Community A small percentage of each transaction supports charitable causes, ensuring MegaBase creates global impact alongside financial growth. 💎 Community members will have the opportunity to earn rewards as MegaBase reaches key milestones. This giveaway is our way of saying thank you for believing early and building with us. 🔗 Join the MegaBase Movement ✅Telegram: https://t.me/+IQ696SfodDQwOTEx Twitter: www.x.com/megabasecoin ✅Website: https://megabasecoin.com Let’s build together. Let’s grow together. Let’s succeed together. 💪 #MegaBase#MGBS#Cryptolaunch#LaunchGiveaway#DeFi#Web3#Blockchain#CommunityWealth#Crypto#Base#Coinbase#Bullrun#Bitcoin#Ethereum#DEX#CEX#Bullish

⚡️𝗣𝗮𝗿𝘁𝗻𝗲𝗿𝘀𝗵𝗶𝗽 𝗔𝗻𝗻𝗼𝘂𝗻𝗰𝗲𝗺𝗲𝗻𝘁 ⚡️ ᶜʳʸᵖᵗᵒ ¹⁰⁰ˣ ⱽ ᴹᵃʳˢᵒ ᵒⁿ ᴱᵀᴴ ⁽ ᴮᵃˢᵉ ⁾🔹 Marso Token: The Next BIG Thing in Crypto is Here! 🔥🔥🔥 🚀 The new BIG thing in the crypto market is here: Marso Token is launching, and it’s coming in HOT! Ready to soar, Marso Token is set to redefine possibilities in the crypto universe. 🫡🫡🫡 Join our journey, follow all our socials, stay tuned for the latest updates, and don’t miss your chance to invest early! ⭐️⭐️⭐️⭐️⭐️ 🤑🤑🤑 Get in on the action now—exclusively on BitMart! Let’s make history together with Marso Token. 🥰🥰🥰 🤩🤩🤩🤩 Join the Marso community for exciting news, contests, and more. This is only the beginning, and you’re invited to be part of it. 🤟🤟🤟 ✅Website: marso.tech ✅Telegram: https://t.me/MarsoUniverseCommunity 🚀X: https://x.com/marsouniverse?s=21 📱Instagram: https://www.instagram.com/marsouniverse?igsh=ZjR4cW5vZXVpdmMy&utm_source=qr #MarsoToken#CryptoLaunch#BiggestCrypto#InvestNow#CryptoCommunity#Bitmart#MarsoUniverse#AltcoinSeason#CryptoFuture#BlockchainInnovation#EarlyInvestors#CryptoBuzz#NextBigCoin#FutureOfFinance#MarsoToTheMoon