@NEASingapore · Post #1171 · 19.11.2025 г., 01:00
Clean recyclables belong in the blue recycling bin. But used batteries? They’re not that girl. 💅 Let’s #RecycleRight and avoid explosive drama.
Hashtags
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
Пребарај: #recycleright
@NEASingapore · Post #1171 · 19.11.2025 г., 01:00
Clean recyclables belong in the blue recycling bin. But used batteries? They’re not that girl. 💅 Let’s #RecycleRight and avoid explosive drama.
Hashtags
@NEASingapore · Post #1167 · 12.11.2025 г., 01:02
Only fully emptied aerosol cans should go in the blue recycling bins. Partially filled ones pose fire hazards and can cause explosions or fires. 💡Tip: Press until you can no longer hear a hissing sound! Visit go.gov.sg/recycling-guide to learn how to #RecycleRight and prevent fires in recycling bins and trucks.
Hashtags
@NEASingapore · Post #1052 · 05.06.2025 г., 00:06
Make the switch to reusables and make sure to #RecycleRight. Together, we can reduce plastic waste and protect our environment.
Hashtags
@NEASingapore · Post #706 · 29.11.2023 г., 01:00
Items that contain food or drink residue cannot be recycled. They may even contaminate other recyclables, putting everyone’s good effort to waste! Remember to empty and rinse your bottles or drink cans before recycling them. Let's #RecycleRight! ♻️🌟
Hashtags
@NEASingapore · Post #695 · 30.10.2023 г., 04:31
Explore refreshing new adventures in the world of sustainability by joining us on Lemon8. Let’s leave a trail of green footprints as we learn together, discover useful hacks and crafts, #RecycleRight guides and tips, and much more! Follow us at go.gov.sg/nea-lemon8 (or search for nea_sg), and let's sprinkle some citrusy eco magic together!
Hashtags
@NEASingapore · Post #557 · 01.06.2023 г., 01:02
Missed the nationwide Bloobox distribution? Good news! You can collect it at selected libraries on weekends this June, and learn more about how you can start a recycling corner at home and #RecycleRight. While stocks last!
Hashtags
@NEASingapore · Post #534 · 04.04.2023 г., 03:30
Planning to collect a Bloobox? Don’t forget to check the stock levels before heading down: https://www.gowhere.gov.sg/bloobox Together, let’s #RecycleRight: https://www.go.gov.sg/recycleright
Hashtags
@NEASingapore · Post #518 · 18.03.2023 г., 01:15
It’s Global Recycling Day, so let’s be reminded to #RecycleRight! If you’re not sure whether an item can be recycled, check with Bloobin: www.cgs.gov.sg/recycleright/check-my-item
Hashtags
@NEASingapore · Post #517 · 17.03.2023 г., 02:22
From 19 Mar to 30 Apr 2023, all households can collect a free Bloobox to start the habit of recycling at home. It also comes with guidelines on what can be recycled. Let’s #RecycleRight! More info at www.gowhere.gov.sg/bloobox
Hashtags
@NEASingapore · Post #502 · 05.02.2023 г., 02:01
As the Lunar New Year festivities come to an end, let’s recycle what we can! Instead of throwing away plastic containers that were used to contain the goodies, reuse or recycle them. Not sure whether an item can be recycled? Find out at www.cgs.gov.sg/recycleright/check-my-item #RecycleRight
Hashtags
@NEASingapore · Post #473 · 09.12.2022 г., 00:20
Are they friend or foe? Bloobin and the E-Waste Recycling Bin are working towards the same goal – to minimise waste and helping Singapore become a Zero Waste Nation. Here’s a quick guide to get to know them, so that you can #RecycleRight! go.gov.sg/recycleright
Hashtags
@NEASingapore · Post #380 · 12.07.2022 г., 07:05
Not sure what to do with your e-waste? Check out the infographics below to find out what you can recycle, and how to recycle. More information at https://go.gov.sg/e-waste#RecycleRight
Hashtags