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

Резултати

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

Пребарај: #fellowship

当前筛选 #fellowship清除筛选
Opportunities with Zula

@opportunities_zula · Post #352 · 08.10.2025 г., 14:39

Echidna Global Fellowship 2026 (Fully Funded in USA) 🇺🇸 Visit: https://opportunitiescorners.com/echidna-global-scholar-program/ The Program Covers Stipend, Airfare Tickets, Accommodation, Visa Cost, and Health Insurance. #OpportunitiesCorners#Fellowship#USA

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #23703 · 07.04.2026 г., 11:00

【🚀AI 人工智慧|OpenAI Safety Fellowship 開放申請:外部研究員加入 AI 安全研究,截止日 5 月 3 日 】 #OpenAI#Safety#Fellowship 📍請見報導: https://abmedia.io/openai-safety-fellowship-2026-apply-ai-alignment-research 📍訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

Opportunities with Zula

@opportunities_zula · Post #1443 · 06.03.2026 г., 19:38

04 Days Left to Apply: Summer Research Program 2026 in Bulgaria 🇧🇬 (Fully Funded) Visit: https://opportunitiescorners.com/bulgaria-insait-summer-fellowship/ 12 Weeks Summer Internship for all the Nationals. No IELTS. No Fee. The Program Covers Airfare, Accommodation, 2000 Euro Stipend, and Visa Support. Deadline: 8 March 2026 #BulgariaSummer#Fellowship#OpportunitiesCorners

Opportunities with Zula

@opportunities_zula · Post #764 · 10.12.2025 г., 17:35

MIT KSJ Fellowship 2026/27 in USA 🇺🇸 (Fully Funded) Visit: https://opportunitiescorners.com/mit-ksj-fellowship/ 9 Months Program. Open to all the Nationals. The Program Covers Airfare, Housing, Insurance, 85000 USD Stipend. #KSJ#USA#Fellowship#OpportunitiesCorners

Opportunities with Zula

@opportunities_zula · Post #885 · 25.12.2025 г., 23:31

2026 Berlin Fellowship in Germany 🇩🇪 (Fully Funded) Visit: https://opportunitiescorners.com/berlin-fellowship-program/ The Program Covers Airfare, Meals, Accommodation, Monthly Stipend, Living Expenses, Health Insurance. #Berlin#Fellowship#Germany#OpportunitiesCorners

Field research fellowship If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. Data Analytics for Public Policy Fellowship is a 2 months , fully online program that allows you to explore the world of quantative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from 5th January to 15th March 2025, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by 4th January. https://iisppr.org.in/data-fellowship/ #UPSC#CareerPlanning#Fellowship#NewOpportunities

Field research fellowship If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. The IISPPR Field Research Fellowship is a one-month, fully online program that allows you to explore the world of qualitative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from September 1 to 30, 2024, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by August 15 https://iisppr.org.in/ #UPSC#CareerPlanning#Fellowship#NewOpportunities

Field research fellowship If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. The IISPPR Field Research Fellowship is a one-month, fully online program that allows you to explore the world of qualitative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from September 1 to 30, 2024, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by August 15 https://iisppr.org.in/ #UPSC#CareerPlanning#Fellowship#NewOpportunities

Field research fellowship If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. The IISPPR Field Research Fellowship is a one-month, fully online program that allows you to explore the world of qualitative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from September 1 to 30, 2024, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by August 15 https://iisppr.org.in/ #UPSC#CareerPlanning#Fellowship#NewOpportunities

🇫🇷 Paris Collaborative Fellow 2026 | Fully funded Дедлайн: 26 февраля 2026 | Страны: все | Уровни: школьники 12–18 лет Что покрывают Участие в глобальной программе для молодых инноваторов Возможность презентовать проект перед международной экспертной панелью Наставничество и сопровождение Возможные предложения стажировок и рекомендательные письма Доступ к международному сообществу участников из 80+ стран Где учиться Paris Collaborative (международная программа, онлайн/гибридный формат) Подать онлайн: https://pariscolab.com #fellowship#innovators#youth#startup#science#technology#socialimpact

Crypto M - Crypto News

@CryptoM · Post #65271 · 12.04.2026 г., 13:09

🚀 Tether-Linked Super PAC Reports $300,000 Ad Spend Amid Zero Account Balance Fellowship, a super PAC reportedly associated with Tether, has revealed a $300,000 advertising expenditure to Nxum Group, a company co-founded by Tether US CEO Bo Hines. According to NS3.AI, the Federal Election Commission filing indicates that the spending was in support of Georgia Republican Clay Fuller. Despite this significant expenditure, Fellowship's current federal disclosures continue to show its accounts at zero, even after a prior announcement that it would be established with pledges totaling $100 million. #Tether#SuperPAC#AdSpend#NxumGroup#BoHines#FederalElectionCommission#GeorgiaRepublican#ClayFuller#Fellowship#PoliticalExpenditure#ZeroBalance#NS3AI