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

Резултати

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

Пребарај: #cryptocurrency

当前筛选 #cryptocurrency清除筛选
The Hacker News

@thehackernews · Post #8826 · 18.04.2026 г., 08:00

Sanctioned #cryptocurrency exchange Grinex is shutting down after a $13.74M hack. Stolen funds were quickly moved and swapped to avoid freezing. The platform is linked to Garantex, flagged for laundering over $100M. 🔗 Read → https://thehackernews.com/2026/04/1374m-hack-shuts-down-sanctioned-grinex.html

🦅 [ perspective ix ]

@perspectiveix · Post #1281 · 20.05.2018 г., 19:30

​​💰With at least $1.3 billion invested globally in 2018, VC funding for blockchain blows past 2017 totals 🚀@PerspectiveIX Read more at t.me/iXNews/25659 Do you own any #CryptoCurrency? 👍🏻 Yes 😅 No, but I'm thinking of buying 👎🏻 No, not interested at all

DWF Labs Broadcast

@Dwflabs · Post #183 · 27.01.2023 г., 03:05

Fans of the TON #cryptocurrency now have a new way to trade their favorite altcoin following its addition to the options trading markets on the popular exchange platforms BIT and Paradigm. The options are live on the platform today and will be available on the institution-focused liquidity network Paradigm later, the exchange said in a statement shared with CoinDesk. The options are launched in collaboration with liquidity provider Darley Technologies and blockchain industry market maker and TON-backer DWF Labs. "Joining the options market is a logical and important step for TON because, until now, the only coins available there were BTC and ETH. It means TON will take its place alongside crypto's most prestigious coins," said Andrei Grachev, Managing Partner at DWF Labs. Full read here: https://lnkd.in/g6zACNN7

🗺 Travel the World | Private Expeditions

@expeditionsworldwide · Post #52 · 12.08.2020 г., 04:30

📊Intermediate statistics for the experimental portfolio: Days elapsed since launch: 20; Purchased 18 coins: #BTC #XRP #REP #EOS #NEO #STRAT #BSTX #OGN #ETC #ICX #LTC #CELR #QTUM #DASH #BEAM #LTO; Already Invested (since launch): $200 Total profit (since launch): 7.02% 📊Detailed portfolio statistics - https://bit.ly/30GlvN2 ➕FIBONACCI $10 Experiment (#cryptocurrency)

Trump's Ear

@trumpsear_tg · Post #1448 · 02.09.2025 г., 13:59

Trump earned more in cryptocurrency in a day than in real estate in his entire life - The Wall Street Journal On September 1, the WLFI token, another cryptocurrency issued by the Trump family, began trading on exchanges. The price of the token on the first day of trading fell by more than a third from its peak value, but despite this, the Trump fortune increased by more than $5 billion per day. This is much more than the value of all the real estate owned by Trump. #Trump#cryptocurrency 👂More on Trump's Ear ⚠️

TONlines – News

@tonlines · Post #7324 · 22.05.2025 г., 11:25

⚡️TON Community: Join the Ultimate TON NFT Gathering in Lisbon #TON#cryptocurrency TON Community announces an exclusive one-day event, TON of People, in Lisbon on June 5, 2025. The event will feature key figures from the TON blockchain and cryptocurrency communities, providing insights into NFTs and blockchain marketing. Attendees will also have access to additional events during the NFC Summit. Source: link @tonlines

TONlines – News

@tonlines · Post #6753 · 14.04.2025 г., 12:08

⚡️xRocket News: Real-Time Crypto Rates and Referral System #Telegram#cryptocurrency xRocket News introduces a new @xrocket dash command in Telegram that provides instant cryptocurrency rates and changes within chats. Users can also benefit from a built-in referral system by typing @xrocket dash followed by desired tokens. The rates automatically update every 30 minutes in larger groups or channels. Source: link @tonlines

DWF Labs Broadcast

@Dwflabs · Post #167 · 20.01.2023 г., 07:40

BIT x DWF Labs Crypto Snapshot [13 Jan] 📰 Highlights: 🔸Shanghai Upgrade Well On Track With Latest Testnet Developments 🔸#Bitcoin Rebounds From Its Lows Back To $21,000 🔸Innovation And Sound Practices Are Key For #Cryptocurrency Integration Full read here.

TONlines – News

@tonlines · Post #7055 · 05.05.2025 г., 16:22

Trending Apps: Discover TonTradingBot for Seamless Crypto Management #Cryptocurrency#Web3 Trending Apps highlights TonTradingBot, a comprehensive solution for crypto enthusiasts to manage trading operations directly within the chat. It offers features such as sniper mode, limit orders, and copy-trading, along with tools like Fast Swap and Honeypot Detection, promising secure and fast performance. Source: link @tonlines

123•••10•••20•••30•••40•••4344
ПретходнаСтраница 1 од 44Следна