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

Резултати

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

Пребарај: #halo

当前筛选 #halo清除筛选
Mega Signals Group

@mega_pump_group · Post #1859 · 19.11.2023 г., 18:38

Pump result: Today's pump on Kucoin shocked us all with the massive volume, this was expected as we onboarded over 30,000 members in the past two weeks. However, due to unprecedented sell pressure from the #HALO team, we had expected a much larger rise in price. In fact internally we had discussed that we will be targeting around 900-1000% which we still tried to achieve with our team buying endless amounts after the first few minutes to guarantee that our members make good enough profit . Nonetheless, member's managed to profit over 150% during the signal, and with the support of our team we even managed to provide a second and third wave for extra profits which means anyone that has bought the dips during the signal had the chance to instantly make a lot of profits! We are receiving an overwhelming amount of positive messages from our community and we're happy to hear so many of you profited. From this point on, our signals will only get stronger, and you can be confident that we will use all the power we have to keep reaching higher targets. As the majority of you are aware, our greatest pump to date generated a profit for our members of around 2000%, and now our primary focus is to see if we can repeat that sort of pump. It will be quite easy to accomplish with our existing power. It can happen once again if we don't face any sell pressure coming from the coin team itself which is something that can be hard to avoid at times, hopefully we can achieve that result once again on the next one. Stay tuned for the next pump announcement.

Hashtags

Crypto Pump Club

@crypto_bitcoin_pumps_signal · Post #587 · 19.11.2023 г., 18:39

Pump result: Today's pump on Kucoin shocked us all with the massive volume, this was expected as we onboarded over 30,000 members in the past two weeks. However, due to unprecedented sell pressure from the #HALO team, we had expected a much larger rise in price. In fact internally we had discussed that we will be targeting around 900-1000% which we still tried to achieve with our team buying endless amounts after the first few minutes to guarantee that our members make good enough profit . Nonetheless, member's managed to profit over 150% during the signal, and with the support of our team we even managed to provide a second and third wave for extra profits which means anyone that has bought the dips during the signal had the chance to instantly make a lot of profits! We are receiving an overwhelming amount of positive messages from our community and we're happy to hear so many of you profited. From this point on, our signals will only get stronger, and you can be confident that we will use all the power we have to keep reaching higher targets. As the majority of you are aware, our greatest pump to date generated a profit for our members of around 2000%, and now our primary focus is to see if we can repeat that sort of pump. It will be quite easy to accomplish with our existing power. It can happen once again if we don't face any sell pressure coming from the coin team itself which is something that can be hard to avoid at times, hopefully we can achieve that result once again on the next one. Stay tuned for the next pump announcement.

Hashtags

便宜机场测速

@cheap_proxy · Post #12001 · 05.08.2025 г., 15:37

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11306 · 03.01.2025 г., 08:14

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11276 · 29.12.2024 г., 07:22

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11751 · 08.05.2025 г., 12:09

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #成都移动1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11977 · 29.07.2025 г., 01:48

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #河北联通1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11479 · 16.02.2025 г., 11:15

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #河北联通1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

Interesting Planet 🌍

@interesting_planet_facts · Post #415 · 25.07.2025 г., 14:22

🌎 Sun halos, circular rainbows encircling the sun, form when sunlight passes through high-altitude ice crystals. These brilliant rings are a natural spectacle, often signaling incoming weather changes. ✨ #sun⚡#halo⚡#atmosphere⚡#optics 👉subscribe Interesting Planet

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