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

Резултати

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

Пребарај: #pvp

当前筛选 #pvp清除筛选
TONlines – News

@tonlines · Post #7460 · 30.05.2025 г., 14:31

⚡️Gatto Official Channel: PvP Event with Rewards #GTON#PvP Join the Gatto Official Channel for an exciting PvP event and fight against the GTeam from 15:00 UTC today. Players can earn special rewards by achieving consecutive wins against the GTeam, with the event running until May 30. European server only. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7699 · 03.12.2025 г., 17:32

MRKT: New Winter League Begins #MRKT#PVP The MRKT channel announces the start of the Winter Open League, bringing new competitions and rewards after the completion of the Autumn season. Players can look forward to fresh rankings, new rivals, and exclusive prizes including the Heart Locket and Durov’s Cap. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7559 · 21.11.2025 г., 11:48

⚡️MRKT: Important Update on PVP Competition Rules #MRKT#PVP MRKT announces a new rule to ensure fair competition in PVP leaderboards. Contributions exceeding 92% of a game's pool will not influence tournament rankings. Participants are encouraged to play fairly. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7545 · 20.11.2025 г., 13:12

MRKT: New Feature Enhances PvP Experience #MRKT#PvP MRKT introduces PvP Reactions, allowing players to drop reactions during fights to enhance excitement and energy in battles. This feature aims to change the atmosphere of the arena. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7507 · 18.11.2025 г., 10:25

MRKT Enforces Fair Play in PvP Events #MRKT#PvP MRKT emphasizes fair play in all PvP events, actively monitoring for suspicious activities like volume boosting and artificial staking. Participants found engaging in abuse or manipulation risk being banned without explanation. Source: link @tonlines

Hashtags

TONlines – News

@tonlines · Post #7523 · 19.11.2025 г., 09:47

⚡️MRKT: Last Hours of PvP Tournament Finale #PvP#Tournament The MRKT channel announces that there are only 9 hours left in the Autumn Open League PvP Tournament. Participants still have the chance to improve their standings with every fight, stake, and point. Source: link @tonlines

TONlines – News

@tonlines · Post #6839 · 18.04.2025 г., 14:24

⚡️Gatto Official Channel: Weekend Tournament Rescheduled #tournament#PvP The Gatto Official Channel has announced the cancellation of the weekend tournament due to technical improvements in PvP mode. The event has been rescheduled to April 25, with double rewards offered for skipping. More details will be provided on the event day. Source: link @tonlines

Hamster Games

@hamster_tools · Post #1964 · 09.03.2026 г., 11:54

⚔️FOMO Fighters Player Database is Live! Looking for opponents for PvP battles in 🔥Fomo Fighters ? Now it's easier than ever. I’ve created ⚡Fomo Tools — a app that collects the entire player database in one place so you can quickly search and find fighters. ⚔️What you can do: 🟢Find any player instantly 🟢Search fighters for PvP battles 🟢Explore the growing Fomo Fighters community No more endless scrolling or guessing usernames — just search and battle ⚔️ Try it here: 📣 @FomoTools If you enjoy the tool, feel free to share it with other fighters and make the PvP scene even more active! #fomo#fighters#FomoFighters#PvP#tools

TONlines – News

@tonlines · Post #7666 · 01.12.2025 г., 15:12

Gatto Official Channel: Celebrating Two Years of Growth #Gatto#PvP#BattlePass Gatto Official Channel marks its second anniversary with numerous updates and improvements. Over the past year, the game has expanded its offerings with new PvP mechanics, a Battle Pass, and additional content, enriching the player's experience. As the community celebrates, special events and items are available, leading up to upcoming giveaways. Source: link @tonlines

Ganar Dinero Seguro

@ganardineroseguro · Post #1171 · 05.09.2023 г., 18:17

✅Nueva actualización del juego Solitario de THNDRGAMES. ⚒️ Ahora están disponibles los duelos PvP y por supuesto el que gane va a ganar satoshis 👉Más info aquí: https://www.thndr.games/post/duels ✅Actualice la app si ya la tiene, sinó descarga los juegos aquí: ⚡THNDRGAMES #pvp#p2e#btcln#freebtc

12
ПретходнаСтраница 1 од 2Следна