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

Резултати

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

Пребарај: #aitrader

当前筛选 #aitrader清除筛选
Propheta Indicator Signals

@propheta_indicator · Post #23334 · 17.02.2026 г., 11:27

👀 Well, would you look at that! 👆 Reached 9th TP in the VIP HTL channel! ACCESS TO MANUAL TRADING for 70usdt/month 💰Turn data into gains with Propheta AI Analyzer: deep AI analysis spots trends with surgical precision, tweaks in seconds to your goals, and pair hunting pumps your trading to the next level — this is the evolution of the game! GET THE ACCESS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #trading#AItrader#cryptonews

Propheta Indicator Signals

@propheta_indicator · Post #23483 · 16.03.2026 г., 13:34

Oops, we did it again 🤣 Reached 9th TP in just 5 hours in the VIP HTL channel! Easy $318 with a 5% entry and a $1000 deposit! Every day we're on fire! 🔥🔥🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 Not sure? Considering? Contemplating? Come have a look at our performance reports, spend about5 minutes and see for yourself that everything is 100% legit! @propheta_reports Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #bitcoin#AItrader#tradingview

Propheta Indicator Signals

@propheta_indicator · Post #23313 · 07.02.2026 г., 11:18

Oops, we did it again 🤣 Reached 9th TP in just 1 day in the VIP CLUB channel! You could've earned $311 with a 5% entry and a $1000 deposit! ACCESS TO MANUAL TRADING for 70usdt/month 👉 Did you know that our referral partners receive extra discounts, even cumulative with the special offer prices? START >>> Referral Program Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #AItrader#signalchannel#buycrypto

Propheta Indicator Signals

@propheta_indicator · Post #23725 · 16.04.2026 г., 19:16

Oops, we did it again 🤣 Reached 9th TP in the VIP PRO channel! You could've earned $603 with a 5% entry and a $1000 deposit! Feels good to be a Propheta VIP, man... 🏖ACCESS TO MANUAL TRADING for 70usdt/month 👉 Multiplying deposits every day! Not convinced? Contact us for a free trial - @propheta_help Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #AItrader#passiveincome#cryptochannel

Propheta Indicator Signals

@propheta_indicator · Post #23461 · 13.03.2026 г., 16:33

👆 OMG! Would you look at that 👀 Reached 9th TP in just 11 hours in the VIP PRO channel! $409 in profits with a 5% entry and a $1000 deposit! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 👉 Did you know that many traders use our performance reports to build their own trading strategy? That's how useful they are! Check them out: @propheta_reports Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #AItrader#passiveincome#crypto

Propheta Indicator Signals

@propheta_indicator · Post #23082 · 21.11.2025 г., 03:06

Oops, we did it again 🤣 Reached 9th TP in the VIP HTL channel! $203 in profits with a 5% entry and a $1000 deposit! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 💪Rule the market with Propheta AI Signals: ultra-sharp alerts, full-on process automation, and a killer Cornix synergy — your fast track to max profits! GET THE ACCESS TO AI SIGNALS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #buyeth#cryptobot#AItrader

Propheta Indicator Signals

@propheta_indicator · Post #23108 · 26.11.2025 г., 16:20

Reached 9th TP in just 3 hours in the VIP PRO channel! Easy $513 with a 5% entry and a $1000 deposit! Every day we're on fire! 🔥🔥🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 Time to start earning for real! Join us >>> t.me/ProphetaAdmin_bot Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #cryptochannel#signalchannel#AItrader

Propheta Indicator Signals

@propheta_indicator · Post #23716 · 16.04.2026 г., 02:41

Now that's trading 👆🔥🔥🔥 Reached 9th TP in the VIP PRO channel! Easy $100 with a 5% entry and a $1000 deposit! VIPs getting filthy rich by the day ☺️🤑🤑ACCESS TO MANUAL TRADING for 70usdt/month 👉 Looking at those reports and can't believe what you're seing? Go to our reports channel and audit us! @propheta_reports Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #AItrader#passiveincome#CryptoSignal

Propheta Indicator Signals

@propheta_indicator · Post #23324 · 13.02.2026 г., 16:10

👆 Propheta living up to its name yet again 🔮 Reached 9th TP in just 36 minutes in the VIP PRO channel! $277 in profits with a 5% entry and a $1000 deposit! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 👉 Did you know that our referral partners receive extra discounts, even cumulative with the special offer prices? START >>> Referral Program Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #buycrypto#tradingbot#AItrader

Propheta Indicator Signals

@propheta_indicator · Post #23320 · 12.02.2026 г., 09:33

👀 Well, would you look at that! 👆 Reached 9th TP in just 1 day in the VIP PRO channel! $620 in profits with a 5% entry and a $1000 deposit! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 👉 Did you know that our referral partners receive extra discounts, even cumulative with the special offer prices? START >>> Referral Program Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #AItrading#ethereum#AItrader

Propheta Indicator Signals

@propheta_indicator · Post #22888 · 10.10.2025 г., 15:31

👍 This is why we're here! Reached 9th TP in the VIP HTL channel! Feels good to be a Propheta VIP, man... 🏖ACCESS TO MANUAL TRADING for 70usdt/month 💸Turn time into cash with Propheta AI Signals: pinpoint entries and exits, AI-powered automation, and perfect Cornix compatibility — your automated win streak! GET THE ACCESS TO AI SIGNALS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #tradingbot#signalchannel#AItrader

Propheta Indicator Signals

@propheta_indicator · Post #23476 · 16.03.2026 г., 08:01

👀 Well, would you look at that! 👆 #ENAUSDT has just reached 9th TP in the VIP CLUB channel!!!👍 With a 5% entry and a $1000 deposit, you could've earned $461! Every day we're on fire! 🔥🔥🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 Not sure? Considering? Contemplating? Come have a look at our performance reports, spend about5 minutes and see for yourself that everything is 100% legit! @propheta_reports Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #AItrader#cryptobot#cryptochannel

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