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

Пребарај: #decentralizedfinance

当前筛选 #decentralizedfinance清除筛选
Crypto M - Crypto News

@CryptoM · Post #64468 · 09.04.2026 г., 01:43

🚀 Solstice Finance Expands DeFi Asset Management with eUSX Growth Solstice Finance is advancing decentralized finance (DeFi) asset management beyond single-strategy vaults, according to Tiger Research. The platform's eUSX has reached approximately $360 million in total value locked (TVL). According to NS3.AI, Solstice is currently operating eUSX and is preparing to launch strcUSX and oUSX. However, the platform still encounters challenges related to on-chain profit verification, funding-fee volatility, and team execution risk. #DeFi#SolsticeFinance#AssetManagement#eUSX#TVL#Blockchain#Crypto#DecentralizedFinance#FinanceInnovation

Crypto M - Crypto News

@CryptoM · Post #64760 · 09.04.2026 г., 19:58

🚀 DeFi Security Concerns Raised After Drift Hack Ann Irvina Ravinther, former marketing head at Drift Labs, expressed concerns over the security of decentralized finance (DeFi) following a recent hack that resulted in a personal loss of $76,000. According to NS3.AI, Ravinther highlighted that such security vulnerabilities pose significant challenges for mainstream adoption by traditional financial markets. #DeFi#SecurityConcerns#DriftHack#AnnIrvinaRavinther#NS3AI#DecentralizedFinance#MainstreamAdoption#TraditionalFinancialMarkets

Crypto M - Crypto News

@CryptoM · Post #64776 · 09.04.2026 г., 22:11

🚀 CFTC and DOJ Legal Actions Could Influence Future of Prediction Markets The Commodity Futures Trading Commission (CFTC) and the Department of Justice (DOJ) have initiated legal proceedings against the states of Arizona, Connecticut, and Illinois concerning their actions against CFTC-registered prediction markets. According to NS3.AI, a recent 2-1 ruling by the Third Circuit Court upheld an injunction preventing New Jersey from applying its gambling laws to Kalshi, a prediction market platform. The court determined that Kalshi's contracts related to sports events are classified as swaps under the Commodity Exchange Act, thereby falling under the exclusive jurisdiction of the CFTC. This legal dispute has the potential to significantly influence the regulatory framework for decentralized prediction markets and crypto-native derivatives across the United States. #CFTC#DOJ#PredictionMarkets#Kalshi#CommodityExchangeAct#Regulation#CryptoDerivatives#USLaw#LegalActions#DecentralizedFinance

Crypto M - Crypto News

@CryptoM · Post #64928 · 10.04.2026 г., 10:22

🚀 Aave Faces Internal Challenges Amid Governance Disputes PANews posted on X (formerly Twitter). Aave, a prominent player in the decentralized finance (DeFi) sector, is currently facing significant internal challenges that are proving more daunting than the ongoing bear market. The departure of three key service providers—BGD Labs, ACI, and Chaos Labs—marks a critical juncture for the platform. These exits highlight a clash between the founder's vision and decentralized governance. Aave Labs, which holds 23% of the token voting power, is pushing for a transition to V4. However, the service providers have found themselves without a voice in the decision-making process, while also facing increasing legal risks. This situation has led them to withdraw their support, effectively voting with their feet. The troubles facing Aave underscore the fact that risks in the DeFi space are not solely market-driven. Sometimes, the most significant threats come from within the organization itself. #Aave#DeFi#GovernanceDisputes#DecentralizedFinance#InternalChallenges#TokenVoting#V4Transition#LegalRisks#ServiceProviders#AaveLabs#AAVE

Venture Village Wall 🦄

@venturevillagewall · Post #4124 · 11.02.2025 г., 16:00

Major ETH Transfer and Lido V3 Launch 🚨 29,250 #ETH (~$77.8M) transferred from #Binance to an unknown wallet, according to Whale Alert. In other news, Lido has launched V3 with customizable ‘stVaults,’ enhancing Ethereum staking flexibility. More details can be found here. 🔍 Analysts from Merkle Science report that in 2024, investors lost over $500M due to fraud linked to meme tokens, primarily through social engineering attacks on platforms like X and YouTube. 📈#HongKong now recognizes $BTC and $ETH for investment visa applications, positioning itself as a competitive hub for crypto investors. 💰 DeFi platform Legend has secured $15M from Andreessen Horowitz and Coinbase Ventures. Stay informed! 🔗Lido V3 Announcement ## Keywords: #ETH#Lido#Binance#Crypto#MemeToken#HongKong#BTC#VC#DeFi#Legend#InvestmentVisa#WhaleAlert#Fraud#SocialEngineering#Ethereum#Investment#CryptoNews#Blockchain#Finance#CryptoInvestors#DecentralizedFinance #ETH#Lido#Binance#Crypto#MemeToken#HongKong#BTC#VC#DeFi#Legend#InvestmentVisa#WhaleAlert#Fraud#SocialEngineering#Ethereum#Investment#CryptoNews#Blockchain#Finance#CryptoInvestors#DecentralizedFinance

Venture Village Wall 🦄

@venturevillagewall · Post #3782 · 03.01.2025 г., 16:00

Lost Dogs Listing Date Announced 📅 The anticipated listing for Lost Dogs is set for January 14, 2025. Key details: - Total token supply: 18 billion - No vesting: All tokens unlocked immediately - Market cap: $100 million; Token price: $0.0055 🗓️ Claim for BUILD scheduled for January 7, potentially introducing PX farming via WOOF + BUILD in EARN. For more updates, join the DOGS community! #Crypto#LostDogs#VC#Blockchain#Farming#TokenListing #Crypto#VC#TokenListing#LostDogs#Blockchain#Farming#BUILD#Claim#CryptoNews#MarketCap#Investment#DecentralizedFinance#DeFi#Tokens#PYX#EARN#WOOF

Crypto M - Crypto News

@CryptoM · Post #64885 · 10.04.2026 г., 06:54

🚀 Tria Integrates Aptos Network for Enhanced Global Transactions Tria, a non-custodial financial operating system, has announced the integration of its global trading engine with the Aptos network. According to ChainCatcher, this integration allows over 500,000 users across more than 150 countries to directly access and trade Aptos assets. Users can now perform cross-chain exchanges and asset interactions within a single application without the need for cross-chain bridges. The collaboration aims to leverage Aptos's sub-second confirmation and parallel execution technology to provide users with a seamless transaction experience. Additionally, it seeks to further connect traditional finance, Web2, and on-chain infrastructure. #Tria#AptosNetwork#GlobalTransactions#NonCustodial#FinancialOperatingSystem#CrossChainExchanges#AssetInteractions#Blockchain#Web2#OnChainInfrastructure#Aptos#Crypto#DecentralizedFinance#Fintech#APT