Что делать если нужно поставить какую-то 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
⚖️Warm welcome to Nomis’ ecosystem – meet TONBanking as our strategic partner!
TONBanking is a decentralized Fintech DeFi platform accessible through a Telegram web app. It provides Telegram users with B2B/B2C service consisting of various tools: virtual cards, gift cards, KYC, acquiring, exchange and more.
As we, here at Nomis, believe and adhere to the pillars of #decentralization, so TONBanking conduct all txs, integrations, DAO voting, dividend payouts, and other activities directly on the TON blockchain via smart contracts. This structure allows the system to operate without jurisdictional limitations 🔐
What's the next stop of Nomis x TONBanking partnership? Stay tuned for fascinating use-cases of leveraging Nomis as a Protocol within the partners’ app!
Stay tuned, turn on notifications, and follow us for further announcements 🔔
🧠 Vitalik: Ethereum Is Built for Freedom, Not Convenience
Vitalik Buterin 強調,Ethereum 從一開始就不是為了「快、便宜、好用」而設計,而是為了「自由、抗審查、韌性」而存在。
#Ethereum#Web3#以太坊#Decentralization#Crypto
———
全文+分析 👇🥇資源搜索群🖲️👆
他原話直指核心:
“This is the game Ethereum is suited to win.”
翻成白話就是:
當世界進入高監管、高衝突、高政治風險時代,
ETH 才是最適合生存的系統。
不是工具鏈,
是制度級底層架構。
❓你認為未來最需要「抗審查」的是哪一塊?
A|資金轉移
B|言論資訊
C|身份系統
D|全部都需要
👇⭐️👇
🤣👇留言你的判斷 👇
🎙💫 This Thursday, we’re thrilled to be joining in on a Twitter Space with OpenDataforWeb3, the builder community DAO fighting for data #decentralization🌐
We'll be chatting about all things #data & KYVE's impact on the space. Set a reminder! ⏰⤵️
https://twitter.com/KYVENetwork/status/1661004134991142912
🤔 Want to create your own dashboard for visualizing #NFT data?
The KYVE Academy has a NEW course, giving you hands-on experience in using KYVE’s trustless data, Data Pipeline, AirbyteHQ,Elasticsearch, & Kibana to do just that!
Try it out 🧑💻⤵️
https://twitter.com/KYVENetwork/status/1660926166411223041
New academy course ⤴️
🌐Explore the Unique Features of Mappasaurus That Set Us Apart!🦖
🗺At Mappasaurus, we’re not just another mapping tool. We integrate cutting-edge technology and user-focused features to provide a mapping experience like no other. Here’s what makes us stand out:
🧠Advanced AI Integration:
🟠Predictive Analytics: Our AI doesn’t just map your route; it predicts future conditions to optimize your journey in real-time.
🟠Customized User Experience: Mappasaurus learns from your preferences and habits, tailoring its functionality to meet your specific needs.
🌿Decentralized Mapping Contributions:
🟢Community-Driven Data: Every user is an integral part of our map-making process. Your contributions directly influence the accuracy and richness of our maps, making them more reliable and comprehensive.
🟢Transparent Updates: See the impact of your contributions as our maps evolve with community input.
🏦Enhanced Privacy and Security:
✅Data Protection: We
prioritize your privacy with advanced encryption and anonymization techniques, ensuring that your data and location details are secure.
✅No Third-Party Sharing: Your information stays with us; we don’t sell data to third parties.
Why Mappasaurus❓
🔴 Join a platform that respects user input, protects your data, and uses AI to enhance your navigation experience. With Mappasaurus, you’re part of a community that’s shaping the future of mapping.
💡 Discover more about our innovative features and join the mapping revolution!
#Mappasaurus#InnovativeMapping#AI#Decentralization#PrivacyFirst
Will Bitcoin reach $100,000 before July 2026?
Markets aren’t just opinions they’re signals.
EdgeMarket turns global sentiment into structured prediction markets where the crowd, data, and AI converge.
Watch the signal form in real time.
What do you think?
#EdgeMarket
#PredictionMarkets
#Bitcoin
#CryptoMarkets
#AI
#Decentralization
#TON
#MarketSignals
#FutureOfMarkets
Bitcoin's Nation State Adoption Threat Insights
Andreas Antonopoulos revisits concerns about nation state adoption of Bitcoin. Highlights the risks of government intervention impacting Bitcoin’s decentralization and the broader cryptocurrency ecosystem. Importance of maintaining Bitcoin’s integrity emphasized amid evolving regulations. For detailed insights, check the full explainer link.
#Bitcoin#Crypto#VC#Decentralization#Regulation#Adoption#Governments#Security
Geopolitical questions rarely move markets when they become obvious.
They move when probability starts shifting before formal signals appear.
That is why prediction systems matter.
Not because they claim certainty, but because they surface how conviction changes while narratives are still forming.
At EdgeMarket, we study how distributed judgement reacts to emerging geopolitical scenarios long before consensus hardens.
The important signal is rarely the headline itself.
It is how probability changes before the headline arrives.
#EdgeMarket#PredictionMarkets#Geopolitics#AI#MarketIntelligence#Decentralization#GlobalRisk#DecisionIntelligence
Hey there, fellow freedom fighters! 🚀⚡
Imagine Nostr leveling up with custom NIPs that let us plug in ANY crypto we want. $XMR for ultimate privacy, $TON for seamless Telegram vibes, or whatever floats your boat. And don't forget stacking Bitcoin + Lightning Network ⚡ with Cashu ecash for that unbreakable privacy layer!
This is how we build unstoppable finance, censorship-resistant social media, decentralized identity, and true non-KYC freedom tech. No more chains just pure sovereignty! Who's ready to make it happen? 🔥
Join the resistance: t.me/DanishCryptoDK | npub1c3gyzcvf2xakqy4vy06umu7hgpr97ttyp05yrlvmk8g8xvmse57qj286r6
#PrivacyMatters#Nostr#XMR#TON#Bitcoin#Lightning#Cashu#Decentralization#FreedomTech
Hey there, fellow freedom fighters! 🚀⚡
Imagine Nostr leveling up with custom NIPs that let us plug in ANY crypto we want. $XMR for ultimate privacy, $TON for seamless Telegram vibes, or whatever floats your boat. And don't forget stacking Bitcoin + Lightning Network ⚡ with Cashu ecash for that unbreakable privacy layer!
This is how we build unstoppable finance, censorship-resistant social media, decentralized identity, and true non-KYC freedom tech. No more chains just pure sovereignty! Who's ready to make it happen? 🔥
Join the resistance: t.me/DanishCryptoDK | npub1c3gyzcvf2xakqy4vy06umu7hgpr97ttyp05yrlvmk8g8xvmse57qj286r6
#PrivacyMatters#Nostr#XMR#TON#Bitcoin#Lightning#Cashu#Decentralization#FreedomTech
Vitalik Buterin on AI's Role
Vitalik Buterin emphasizes AI as a human-controlled tool in his latest article. This framework aims to align technological advancements with human values and needs, reducing the risks of centralized power. He highlights the importance of decentralized systems like blockchain for maintaining diverse and quality decision-making.
#AI#Blockchain#Decentralization#Technology#HumanValues#Control#Innovation#Ethics#Crypto#VC