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

Пребарај: #jimma

当前筛选 #jimma清除筛选
JIFAR CAREER

@JIFAR1 · Post #182 · 09.07.2025 г., 11:24

##Jimma ፎቶ እና ቪዲዮ ኤዲተር መስፈርት ፡- - በማንኛውም የኤዲቲንግ ሶፍትዌር መስራት የሚችል _ ላፕቶፕ ያለው ወይም በቅርበት ኮምፒዉተር ማግኘት የሚችል ጾታ አይለይም ስራው ላይ ብዙ ያልቆየም (ጀማሪ) ቢሆን አበረታታለው ረዳት መስፈርት ፡- ጾታ ሴት - ፎቶ ለመነሳት ብቁ ነኝ ብላ የምታስብ እና ፍላጎት ያላት - አዲስ የስራ ሀሳቦችን መፍጠር የምትችል እና ለስራ አስፈላጊ የሆኑ ቦታዎችን የመምረጥ (የማየት) ችሎታ ያላት - ጊዜ ያላት እና በማንኛውም ቀን ለስራ ዝግጁ መሆን የምትችል @Mintesinot_G | Telegram Inbox | 0967106705

Hashtags

Addis Standard

@addisstandardeng · Post #21633 · 06.03.2026 г., 14:53

News: #Jimma University, #Boeing sign partnership to strengthen aerospace education Boeing and Jimma University have announced a long-term strategic partnership aimed at strengthening aviation sciences and aerospace engineering education and preparing a skilled workforce for #Ethiopia’s growing aviation sector and the wider #African market. In a statement, the partners said the collaboration will support Jimma University’s recently established Aviation Sciences and Aerospace Engineering Academy through infrastructure upgrades, curriculum enrichment, and community engagement initiatives. The program is also expected to lay the foundation for developing Jimma into a future aerospace center of excellence. During the initial phase of the partnership in 2026, the two sides plan to focus on classroom modernization, specialized faculty training, and industry-focused workshops. Henok Teferra Shawl, managing director for Africa at Boeing, said the ..... Read more; https://addisstandard.com/?p=55631

Addis Standard

@addisstandardeng · Post #21617 · 05.03.2026 г., 07:05

News: Fuel shortages deepen in #Addis_Abeba, regional cities as drivers endure prolonged queues Drivers in Addis Abeba and several regional cities report worsening fuel shortages, with prolonged queues and dwindling supplies deepening the strain caused by recent price hikes. At present, beyond rising costs, fuel is reportedly becoming increasingly scarce in cities including #Mekelle, #Jimma, #Ambo and #Bahir_Dar. Drivers who spoke to Addis Standard described spending hours in queues at fuel stations, often with no guarantee of securing supply. A public transport driver in Mekelle said the situation has deteriorated sharply. “Beyond the price hike, it feels like fuel is heading toward complete disappearance. We are buying a 20-litre jerrycan for 8,000 birr, and that too after waiting in line for more than five hours,” he said. Read more: https://addisstandard.com/?p=55586

JIFAR CAREER

@JIFAR1 · Post #380 · 30.12.2025 г., 07:46

❗️❗️NEWS❗️❗️ 🚀 Elevate Your Future Tomorrow Morning! Are you ready to take the next step in your professional journey? Jifar Career Training is coming to Eldan School in Jimma for an exclusive, high-impact session! Where: Eldan School, Jimma When: Tomorrow Morning ከ 2:30 ጀምሮ አይቀርም Focus: Career growth, skill building, and professional success. Don’t just dream about a career—train for it. We are bringing the tools; you bring the ambition. See you all there!📍#Jimma#JifarCareer#EldanSchool#CareerGrowth

Addis Standard

@addisstandardeng · Post #21907 · 01.04.2026 г., 14:38

Business: #Dubai-based premier hospitality group partners with #MIDROC to develop 10 hotels across #Ethiopia The agreement, signed during the Future Hospitality Summit Africa, held at Radisson Blu Hotel, #Nairobi Upper Hill, between 31 March and 01 April 2026, outlines a multi-year rollout of properties across key destinations including #Addis_Abeba, #Hawassa, #Bahir_Dar, #Jimma, and #Langano. The developments are expected to deliver approximately 1,140 hotel keys, with phased openings planned between 2026 and 2031. https://addisstandard.com/?p=56250

#HaSab

@Hasab_2016 · Post #86 · 09.06.2024 г., 08:50

🗣️#DebateSphere was 🔥🔥🔥🔥🔥 The inaugural edition of Debate Sphere in Bishoftu, Ethiopia kicked off with an intense first round of debates. 20 eager participants, divided into 4 teams, took the stage to tackle pressing issues. The energy in the room was 💯 as the teams delivered their arguments with eloquence and conviction, captivating the enthusiastic 👏 audience. Judges listened intently, evaluating the persuasiveness and clarity of the presentations. Friendly handshakes and camaraderie between the teams exemplified the spirit of intellectual discourse, as they engaged in lively rebuttals and challenged each other's perspectives. 🤝 Can't wait to see what's in store for the next destination #Jimma! 🔜🏆 🔅Round 1 pictures🔅 @safelightcommunity #InspireEmpowerTransform 🔆🔅www.safelightet.org🔅🔆 @SafeLightOfficial 👇JOIN US👇 Telegram | Instagram | LinkedIn | Facebook #DebateSphere#BishoftuDebate#CriticalThinking#SafelightetIntiatives #SDG#Transform2032 #MODEL2053 #Agenda2032

Addis Standard

@addisstandardeng · Post #21865 · 27.03.2026 г., 15:38

#In_Depth_Analysis: The #Hormuz Entanglement: Why #Ethiopia’s fuel crisis is a perfect storm of #war, #graft, and #reform While the immediate catalyst appears to be the high-stakes military escalation between the U.S., Israel, and Iran, a deeper look reveals that Ethiopia’s fuel misery is a complex entanglement. It is a “perfect storm” where geopolitical vulnerability, a domestic system rotting from within, and a painful macroeconomic experiment have collided to leave 120 million people running on empty. Until the govt can clean its own house, root out the “senior decision-makers” profiting from the black market, and navigate the treacherous waters of Middle Eastern diplomacy, the accounts emerging from #Gonder to #Jimma to #Ambo, and from #Hawassa to #Bishoftu and #Mekelle, point to an Ethiopia that will remain running on empty. It will be a country “stalled at the intersection of a distant war it cannot control and a local crisis of governance it has yet to master”... https://addisstandard.com/?p=56099