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

Резултати

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

Пребарај: #mytonwallet

当前筛选 #mytonwallet清除筛选

MyTonWallet v3.5 – let's take a look! 💎What has changed: 🫥The transaction feed has become more convenient and informative. "Change" and technical transactions are now grouped and do not interfere with viewing the history, and token icons are displayed during exchange. You can even see the average purchase price of a coin – very convenient 🩷 🫥Hiding the balance – the button is located at the top of the card on the main screen. 🫥 Now creating a deposit link, you can select any TON-token in which you want to receive funds to your wallet. 🫥MyTonWallet NFT cards provide access to advanced interface personalization. All palettes can be seen in the settings. 🔄 Since March 27, the service fee for $MY token exchanges in pairs with TON and USDT has been removed. The #MyTonWallet team hinted that they are working on further updates and exploring new blockchains. 👀 Channel | Chat | Mini-app

Hashtags

TONlines – News

@tonlines · Post #7464 · 31.05.2025 г., 12:59

Updates from TON — LIVE: New Features in MyTonWallet #TON#MyTonWallet TON — LIVE reports that MyTonWallet has introduced an update allowing for mass transfers of TON and tokens in a single transaction, along with new options for renewing multiple TON DNS domains simultaneously. Source: link @tonlines

TONlines – News

@tonlines · Post #6990 · 30.04.2025 г., 16:12

TON — LIVE: MyTonWallet v3.6 Update Released #MyTonWallet#TON TON — LIVE reports that MyTonWallet has released update v3.6, introducing the ability to view any TON and TRON addresses and share links to transfers immediately after sending. The update also includes action previews in dApp and auto-unlock via PIN. Source: link @tonlines

TONlines – News

@tonlines · Post #6922 · 23.04.2025 г., 19:01

TON — LIVE: MyTonWallet to Launch Bank Cards #MyTonWallet#TON The TON — LIVE channel reports that MyTonWallet is planning to introduce bank cards. This development could enhance MyTonWallet's service offerings. Source: link @tonlines

TONlines – News

@tonlines · Post #6820 · 17.04.2025 г., 15:45

TON — LIVE: MyTonWallet Unveils NFT Card Minting #MyTonWallet#NFT MyTonWallet has introduced NFT card minting, available for only 50 active users. These cards offer unique wallet design customization, with more features to be announced soon. Source: link @tonlines

🌿🌸 Spring is Here! Fresh Features from MyTonWallet v3.4 😎The most important news In version v3.4, a mini-app #MyTonWalletappeared inside Telegram. Now you can use your favorite wallet in TMA format 🩷 — @myapp. Just import the Seed phrase from your current TON wallet and you can use it 🤑 Changes and new features: 🔵Knowledge base – a new section in the wallet settings (there is also a direct link to the guides ). For beginners, this is a very useful feature, as there is a lot of information about working with #web3 environment. 🔵 Several new features have been added for working with addresses and transactions. 🔵Transparent fees in TON Connect are a very convenient addition that allows you to see the size of $TON fees 💎Channel | Chat | Mini-app

TONlines – News

@tonlines · Post #7453 · 30.05.2025 г., 12:17

TON — LIVE: Integration of USDe Stablecoin in MyTonWallet #Ethena#MyTonWallet TON — LIVE shares that the USDe stablecoin from Ethena is now integrated into MyTonWallet. Users can also participate in staking with returns up to 18% annually. Source: link @tonlines

TONlines – News

@tonlines · Post #7033 · 03.05.2025 г., 08:20

⚡️Storm Trade: STORM Token Rewards Distributed #STORM#MyTonWallet Storm Trade has announced that rewards in STORM token from the MyTonWallet contest have been successfully distributed. Wallet holders are advised to check their balances. Source: link @tonlines

TONlines – News

@tonlines · Post #6761 · 14.04.2025 г., 17:06

⚡️Storm Trade News: Join the $STORM Trading Tournament! #STORM#MyTonWallet Storm Trade | News has partnered with MyTonWallet for a trading tournament, offering $2,500 in prizes for top $STORM traders. Participants can earn cashback and stake $MY to reduce fees. The tournament runs from April 14–29. Source: link @tonlines

🎙New Interview with the Creator of MyTonWallet TON App Journal recently published a written interview with Alexander Zinchuk, the founder of 💎MyTonWallet. If you're curious about the project’s philosophy and the team’s vision, it’s definitely worth a read Highlights from the conversation: 🔵#MyTonWallet is built on the principles of freedom, user respect, and decentralization. 🔵Security, transparency, and ease of use are top priorities. Features like TON Proxy and multichain standards help make the TON ecosystem more accessible. 🔵 The team is made up of experienced developers focused on minimalist design and intuitive UX. 🔵#MTW was the first wallet on TON to undergo a CertiK audit. 🗣We’re currently working closely with TON Core, DeDust, and Tonscan to improve the speed of transfers and swaps within the network — and that’s just the beginning🗣 , says Alexander. 📖The MyTonWallet blog has been live for nearly six months, sharing major updates and release news (also mirrored in their Telegram channels). 💡 The team also published an important breakdown of a seed phrase theft scheme — a must-read for newcomers.

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