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

Резултати

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

Пребарај: #phrasalverbs

当前筛选 #phrasalverbs清除筛选
English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #60059 · 14.08.2025 г., 17:12

Phrasal verbs with "sleep": ○sleep in ●sleep on ○sleep off ●sleep over ○sleep through sleep in Example: I usually sleep in on weekends. sleep on (it) Example: I’m not sure about this offer. Let me sleep on it. sleep off Example: After the marathon, he slept off his exhaustion. sleep over Example: My friend invited me to sleep over at her house. sleep through Example: I slept through the storm last night. ••┈┈●•❁❁✹❁❁•●┈┈┈•• #phrasalverbs

Journey to Fluency

@fluencyinenglish · Post #7250 · 22.07.2019 г., 04:47

#Phrasalverbs @fluencyinenglish ❇️show up حضور یافتن در جایی When you appear somewhere, you show up. 👉Turn up is similar to show up. Turn up مترادف show up می‌باشد Example: 1. I was supposed to meet my sister for lunch, but she didn't show up. @fluencyinenglish 2. Over a hundred people showed up for the news conference. ____________________________ show up ظاهر شدن When something appears or becomes visible, it shows up. @fluencyinenglish Example: 1. It's hard to photograph polar bears because they don't show up well against the snow. 2. The spots won't show up until the last stages of the disease. @fluencyinenglish ❇️knuckle down If you knuckle down, you start to take your work or your task seriously and do it properly. ❇️For example: knuckle down 🔹The exams start next month, so I guess it's time I knuckled down and studied a bit harder. knuckle down 🔹If Sammy wants to lose weight, he'll have to knuckle down and start exercising more at the gym 🔹knucklehead/n/ UK /ˈnʌk.əl.hed/ US/ˈnʌk.əl.hed/ us informal A stupid person @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #7365 · 16.10.2019 г., 19:42

#vocabulary #phrasalverbs #advanced_vocabulary @fluencyinenglish @fluencyinenglish @fluencyinenglish 🔹amount to something /əˈmɑʊnt·tə, -ˌtu/ ​to add up to, be in total, be equal to, or be the same as Example: Federal and state costs for building and operating prisons amounted to $25 billion. Example: The blog amounts to a critique of the U.S. news media. @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Cede: To give up control; surrender (sēd) Example - "The police officers had to cede control to the FBI agents." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Promenade: Leisurely walk (prŏm′ə-nād′, -näd′) Example - "The couple promenaded around town with matching outfits on." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Cornucopia: Abundant supply (kôr′nə-kō′pē-ə, -nyə-) Example - "My mother loves to garden, she has a cornucopia of fresh veggies in the backyard." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Inimitable: Unmatched; extremely unique (ĭ-nĭm′ĭ-tə-bəl) Example - "No matter how hard I tried, I couldn't recreate the painting of the mountains. It was terribly inimitable, and eventually I gave up." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Coalesce: Fuse together Example - "The two small fires coalesced and turned into one huge raging forest fire. ✅Sharing is caring @fluencyinenglish @fluencyinenglish @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #6450 · 19.09.2018 г., 18:29

#vocabulary #phrasalverbs #advanced_vocabulary @fluencyinenglish @fluencyinenglish @fluencyinenglish 🔹amount to something /əˈmɑʊnt·tə, -ˌtu/ ​to add up to, be in total, be equal to, or be the same as Example: Federal and state costs for building and operating prisons amounted to $25 billion. Example: The blog amounts to a critique of the U.S. news media. @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Cede: To give up control; surrender (sēd) Example - "The police officers had to cede control to the FBI agents." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Promenade: Leisurely walk (prŏm′ə-nād′, -näd′) Example - "The couple promenaded around town with matching outfits on." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Cornucopia: Abundant supply (kôr′nə-kō′pē-ə, -nyə-) Example - "My mother loves to garden, she has a cornucopia of fresh veggies in the backyard." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Inimitable: Unmatched; extremely unique (ĭ-nĭm′ĭ-tə-bəl) Example - "No matter how hard I tried, I couldn't recreate the painting of the mountains. It was terribly inimitable, and eventually I gave up." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Coalesce: Fuse together Example - "The two small fires coalesced and turned into one huge raging forest fire. ✅Sharing is caring @fluencyinenglish @fluencyinenglish @fluencyinenglish

Journey to Fluency

@fluencyinenglish · Post #6207 · 29.06.2018 г., 11:14

#vocabulary #phrasalverbs #advanced_vocabulary @fluencyinenglish @fluencyinenglish @fluencyinenglish 🔹amount to something /əˈmɑʊnt·tə, -ˌtu/ ​to add up to, be in total, be equal to, or be the same as Example: Federal and state costs for building and operating prisons amounted to $25 billion. Example: The blog amounts to a critique of the U.S. news media. @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Cede: To give up control; surrender (sēd) Example - "The police officers had to cede control to the FBI agents." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Promenade: Leisurely walk (prŏm′ə-nād′, -näd′) Example - "The couple promenaded around town with matching outfits on." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Cornucopia: Abundant supply (kôr′nə-kō′pē-ə, -nyə-) Example - "My mother loves to garden, she has a cornucopia of fresh veggies in the backyard." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Inimitable: Unmatched; extremely unique (ĭ-nĭm′ĭ-tə-bəl) Example - "No matter how hard I tried, I couldn't recreate the painting of the mountains. It was terribly inimitable, and eventually I gave up." @fluencyinenglish @fluencyinenglish @fluencyinenglish ✴️Coalesce: Fuse together Example - "The two small fires coalesced and turned into one huge raging forest fire. ✅Sharing is caring @fluencyinenglish @fluencyinenglish @fluencyinenglish

BBC Learning English

@english_bbc_learning · Post #3908 · 26.01.2026 г., 12:16

5 phrasal verbs with “PAY” I shared the questions first on purpose — to make you think before seeing the meanings. That struggle helps the meanings stick better than passive reading. If a meaning surprised you, that’s good — it means your brain is actually learning. #EnglishLearning#PhrasalVerbs#LearnEnglish#RealEnglish