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

Резултати

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

Пребарај: #cryptogrowth

当前筛选 #cryptogrowth清除筛选
TON Crypto News

@toncoin_rap · Post #142 · 13.09.2024 г., 06:29

🎧⤴ TON Blockchain Surges to the Top: Is This the Next Crypto Revolution? The TON Blockchain has taken the crypto world by storm, becoming a leader in terms of annual transaction growth. As one of the fastest-growing blockchains, TON boasts an impressive ecosystem, driven largely by its close association with Telegram and a growing number of users across CIS and Asia. With its remarkable performance, the network outpaces major players like Bitcoin, offering unprecedented potential for Web3 adoption. The future of decentralized applications (DApps) and the crypto economy is being reshaped—TON’s rise to the top is just the beginning! Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Verse 1: Came from Telegram, we ain't here to play, Transactions through the roof, growin’ every day. From the CIS to Asia, crypto on display, The TON revolution’s here, no time for delay. EVM in sight, layer-2 it’s tight, Developers ridin’ with us, keepin’ it light. Bitcoin we outpace, future lookin' bright, Decentralized dreams, man, we takin' flight. Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Verse 2: Open League in the scene, crypto on the rise, With a cabin full of plans, takin' over the skies. Affordable tech, unlockin' minds worldwide, From DeFi to GameFi, come and join the tide. Bridges to Bitcoin, yeah, we breakin’ the mold, Ether’s on notice, TON’s gettin' bold. No airdrop games, just stories untold, It’s the mass adoption wave, come get involved. Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Verse 3: From the shadows we crept, now we're front page, Pushin’ out the limits, we the crypto age. Layer 1 shakin’, disruptin' the stage, Decentralized freedom, come release the cage. Partners in place, with Tether on board, Fintech’s future, where Toncoin’s adored. Validator nodes climbin', pushin' the horde, TON leads the charge, watch us soar like a sword. Chorus: We're TON, blockchain risin', makin' moves you can't deny, Fastest on the block, watch it grow and touch the sky. Transactions flowin' like a stream, unstoppable and wide, Web3’s future’s here, we’re the ones to take the ride. Bridge: Exponential growth, we keep pushin’ the limit, Cryptocurrency dreams, TON’s right in it. Block by block, code never timid, World’s watchin' now, TON’s the one to win it. #TONBlockchain #CryptoGrowth #TONCryptoNewsRapStyle 🎧@toncoin_rap

Venture Village Wall 🦄

@venturevillagewall · Post #3984 · 25.01.2025 г., 19:00

Crypto Trader Gains $1.2 Million Profit Famous trader *Cosmonaut* achieves $1.2 million profit by following whale wallets. Bought Trump token for $5-8 before surge, similar success with SHIBA, PEPE, and FLOKI, each rising over 1000% in six months. Weekly trade signals shared in his Telegram channel predict coins with x5-x10 potential for 2025. Join him here. Pantera Capital's Dan Morehead shares confidence in Bitcoin's resilience, citing ownership by 50 million Americans and institutions like BlackRock and Fidelity back it. #Crypto#Bitcoin#Trading#Profit#Investment#Whales#Tokens#Cosmonaut#SHIBA#PEPE#FLOKI#PanteraCapital#DanMorehead#Solana#Fidelity#BlackRock #2025 #MarketTrends#CryptoGrowth#Telegram

Venture Village Wall 🦄

@venturevillagewall · Post #4190 · 19.02.2025 г., 13:00

OKX Legalizes Operations in Europe OKX has obtained MiCA licensing and passported its services across the European Economic Area (EEA). Over 400 million users in 28 countries can now access fully regulated crypto services via its Malta base. Licensed entities can expand services within the EU under a unified regulatory framework. The platform offers access to over 240 crypto assets and more than 300 trading pairs, including 60+ with Euro. More details: OKX Announcement #OKX#Crypto#EU#MiCA#CryptoRegulation#Malta#Blockchain#Trading#DigitalAssets#CryptoServices#Cryptocurrency#ECC#Fintech#RegulatedCrypto#CryptoGrowth#Investing#Finance#TradingPairs#Economie#CryptoMarket#MarketTrends