Что делать если нужно поставить какую-то 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
📱DegenPhone — phenomenal pool results, what’s next
From the moment the pool opened, all 1,000 numbers sold out in 8 minutes
😮. Due to high demand, +100 more were added, and the first stage closed 30 minutes after launch.
⚡️Recalculation & distribution
• During the sale there were around twenty hacking/DDoS attempts — the team secured the infra, contracts are fine 😎. Because of this, some multipliers were shown incorrectly in the moment.
• The team recalculated distribution from on-chain data (not the dashboard DB), taking the exact timestamp of each transaction and the right multiplier.
• Earliest participants were prioritized. Final supply — 1000 + 100 numbers.
⚡️Refunds
Participants with deposits < 100 TON who didn’t receive an NFT have been refunded. Funds were sent from this wallet
⚡️Promo codes
• Personal promo codes have been sent — please check your dashboard.
• Asked for more bonuses? They’ll be applied at the next auction❤️
⚡️What’s next
• Auction next week. Exact date and time will be announced separately.
• Keep your promo code ready — you’ll need it.
• Follow the channel so you don’t miss the announcement.
The team thanks everyone who took part — this is just the beginning! 🔥
📱Connect your wallet before the next auction
#DEGENPHONE#NFTnumbers#Web3#NFT#eSIM
⚡️DegenPhone goes Live TODAY!
Launch Pool opens 7 August, 19:00 CET — 1,000 NFT phone numbers.
Most of us still rent a number from a carrier and pay more every year while tech gets cheaper. Carriers collect and sell our data, and SIM-based hacks have multiplied. With AI tools going mainstream, those attacks will only grow.
What DegenPhone brings
⭐️Number = NFT. You own it as long as the token sits in your wallet.
⭐️Real Tier-1 eSIM (EU/US).
⭐️Full privacy. No passport, no selfies, no SIM-swap risk.
⭐️SMS from any service (banks, exchanges, 2FA, Uber). Voice is on the near roadmap.
⭐️Liquid asset. Transfer, sell, or gift in one transaction.
⭐️API. A bot reads the code and confirms signup for you.
🙁 Missed anonymous numbers on Fragment? Floor there climbed from 9 TON to ~900 TON (×100). Check what DegenPhone adds on top
NFT eSIM vs Anonymous Numbers
Real eSIM
Fragment: No ❌
DegenPhone: Yes ✔️
Use cases
Fragment: only one — within the Telegram ❌
DegenPhone: full telephony ✔️ (registration on multiple platforms and messengers, SMS reception from any service: banking, exchanges, 2FA, Uber)
Voice calls
Fragment: No ❌
DegenPhone: On the near roadmap ✔️
Bot/AI integration
Fragment: No ❌
DegenPhone: yes ✔️
NFT ownership & privacy
Fragment: yes ✔️
DegenPhone: yes ✔️
Fragment grew on Telegram login alone. DegenPhone delivers more utility, so demand can be even higher. Get in early!
How the multiplier works
⚡️ You can stake any amount of TON, but staking at least 100 TON guarantees you at least one NFT number.
⚡️ The earlier the pool level, the bigger your bonus
Let’s take an example: you stake 100 TON. Then:
• while the pool is under 10 000 TON, your stake counts as 200 TON (+100% multiplier)
• under 25 000 TON, it counts as 175 TON (+75% multiplier)
• under 50 000 TON, it counts as 150 TON (+50% multiplier)
The earlier you join, the more NFTs you get for the same amount
📱 Connect your wallet now
Bonus: one of our referrers will win a Telegram gift — 🎁Tama Gadget #68508 on a black background!
#DEGENPHONE#NFTnumbers#Web3#NFT#eSIM
⚡️ Today: sale of new DegenPhone numbers
Start — August 20, 19:00 CET. This round offers 2,000 NFT numbers. 🔥
The key part: each purchase instantly reserves a new NFT, and the next NFT of the same rarity becomes more expensive — the step is hardcoded in the smart contract. This makes the collection grow in value organically as demand rises.
After all 2,000 are sold, a 7-day vesting starts. Then you can claim the NFTs to your wallet, hold them, or trade freely.
❤️How to get ready:
🔵Connect your TON wallet in the bot and check your balance
🔵 Keep your promo code handy
🔵 New here? Check the Vaults FAQ in the app and the DegenPhone channel
For those taking part: the project is preparing a utility-token airdrop for NFT holders (calls/SMS/AI). Watch for the snapshot announcement and instructions from the team 😎
#DEGENPHONE#VaultAuction#TON#NFTnumbers#eSIM