Что делать если нужно поставить какую-то 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
На просторах интернета наткнулся на китайский стартап Dora AI. Пишешь промпт — и вуаля: анимация таблиц, инфографика, визуализация карт, симуляция чатов и куча всего.
Выглядит круто, но что-то слишком уж гладко и просто. Не тянет ли на очередной развод с «ИИ»? Чувствую, за ширмой тысяча индусов пашут. 😅
Были же прецеденты:
1. Builder.ai (оценка $1,5 млрд) обещал кодить софт и упростить разработку программного обеспечения до уровня "заказа пиццы", а на деле 700 человек вручную работали, обманув Microsoft и Amazon на $500 млн.
2. Kaedim хвастался 3D-моделями от ИИ, но их лепили люди из Аргентины и Индонезии за $1–4.
Dora AI — реальный ИИ или очередной фокус? Можно зарегаться на ранний доступ через Discord
#earlyaccess#ainews | AcidCrunch
🔥 20,000+ Runs and Counting — You’re Forging Legends!
Forgers, you’re absolutely unstoppable🚀
Together, you’ve already completed over 20,000 runs — and the numbers keep climbing.
That’s 20,000+ battles fought and strategies tested.
You’re not just playing — you’re shaping the future of DeckForge with every move.
⭐️ As a thank you:
We’re sending a wave of Stars to the most active players.
Check your wallets — you’ve earned it.
🎁 More rewards are coming!
➡️DeckForge - Play Now!
We see your clips, your insane combos, your feedback.
We see you. And we’re grateful.
Stay fierce. Stay forged.
#DeckForge#ClosedBeta#EarlyAccess
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements👉DeckForge
From the Forge #11: 🔨 | Closed Beta Is Forged
Our Adventure Map is ready to welcome the first wave of players — every node, every choice, every twist now set in place.
Meanwhile, our Art Team is hard at work bringing new Jokers and Bonus Cards to life — adding layers of depth and crazy combos to your future decks.
We’re also preparing a special challenge for our early players — with rewards waiting for those brave enough to take the first steps.
The Closed Beta is just days away.
Get ready — the Forge is heating up 🔥
#DeckForge#ClosedBeta#EarlyAccess
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements👉DeckForge
From the Forge #10: 🔨 | UI Overhaul & Art Expansion
Big things are happening behind the scenes
Over the past weeks, our team has been reworking the UI of DeckForge — and it’s now smoother, sharper, and far more enjoyable to navigate. The updated interface is already integrated into the latest Closed Beta build.
But we’re not stopping there.
Our ARTists are hard at work expanding the visual universe of DeckForge — refining old elements, creating new ones, and pushing the style to the next level.
We're feeling incredibly optimistic as we finalize the build for our earliest players. Soon, you'll step into the experience and help us shape the game’s future.
Your feedback is our forge.
Together, we’re getting closer to Open Beta — one step at a time.
Stay forged 🔥
#DeckForge#ClosedBeta#EarlyAccess
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements👉DeckForge
Why Early Matters
We’re still early.
Which means you’re not just joining a game — you’re getting in before the noise.
🔵 Early players will enter Closed Beta before the public launch.
🔵 You’ll get access to exclusive rewards and collectibles — not available later.
🔵 You’ll help shape the game through feedback, testing, and community votes.
🔵 You’ll build reputation and status before the seasonal competition begins.
🔵 Your progress and impact will carry forward into the full release.
Now’s the time to get in early.
Join the Discord. Get the role. Be part of the first wave.
#DeckForge#EarlyAccess#ClosedBeta
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements
Omchain DID Early Access now! Earn 100 Points to unlock OMC Coin! 🔥🔥
🔥 Secure your Omchain Profile today! 🔥
https://did.omchain.io/?referrer=97187422
Connect your Metamask or mobile wallet, sign in, provide your email, and confirm via email. Invite friends for even more rewards! Stay tuned for exciting updates.
Don't miss out on this limited opportunity! Act now and be part of the Omchain revolution! ✨
#Cryptocurrency#Blockchain#OMCCoin#EarlyAccess
🎙NEW PROJECT 30-100X🔥🔥🔥
🤌 CROSS THE AGES🚀🚀
💫 This is your opportunity to be among the first to experience the #crosstheagesgame and #Metaverse💫
Join this #giveway complete tasks and become apart of something monumental 🤯
Join now🧨
👉https://gleam.io/drnAT/the-cross-the-ages-nft-giveaway👈
#earlyaccess
🎮 DeckForge Discord is LIVE.
The gates to the Forge are finally open — and you can be among the first to enter.
👑 Early players will receive the Pioneers role — a special early access badge that will unlock exclusive rewards and the future Founder Pack.
Here's how to claim your role:
1. Join the DeckForge Discord server.
2. Check out the rules and verify yourself.
3. Go to the #claim thread and get the Pioneers role.
💰 Pioneers role = early access to the Beta, unique rewards, and hidden advantages before the global launch.
The earlier you forge your legacy, the greater your rewards.
See you inside.
🔗DeckForge Discord
#DeckForge#EarlyAccess#FoundersPack
Join the DeckForge Community:
🌐YouTube𝕏Twitter🎮Discord
👉Chat👉Announcements