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 слични објави

Пребарај: #prices

当前筛选 #prices清除筛选
Sayohatnoma: Bagajsiz!

@bagajsiz · Post #83 · 04.02.2025 г., 18:32

#prices "Yorkka sayohat qanchaga tushdi?" Uzr, sal kechikkan post. Xullas, yakuniy hisob-kitoblar qilib ko'ramiz. 1. Transport - Lesterdan Yorkka (borib-qaytish)— £32.50 UK ichkarisida harakatlanish men o'ylagandan ancha qimmat ekan. Mana bu yerda yozgandim. Menda rent car yo'q, shu uchun eng arzon transport avtobusdan foydalandim. 2. York ichida harakatlanish — £0 Shahar ancha kompakt va piyoda yurishga moslashgan. Bu tarafi menga juda yoqdi. Shuning uchun hech qanday transportga hojat yo'q. Albatta, siz daryoda suzgingiz kelib qolmasa. 3. York Minsterga kirish —£16 studentlar uchun + £6 Towerga chiqish Cathedralga kirish pullik ekan. Boshida kirmoqchi emasdim, ammo shuncha joyga kelib ichiga kirmay ketish ham xato bo'lardi. Studentlarga chegirma bor ekan, buning ustiga. Mana shu joyi yoqdi UKning. Studentlarga juda ko'p joyda zo'r sale bo'ladi. Topshiringlar! Towerga chiqish ixtiyoriy. Men ungayam oshiqcha pul to'ladim va bu uchun oyoqlarim meni 2 kun qarg'adi:) 4. Taomlanish Nonushta - £3.85 va tushlik - £20.50 Ovqat mutlaqo o'zizga bog'liq, uydan sendvich qilib kelsangiz ham bo'ladi:) Nega bunaqa deyapman. To'g'risi, diniy tomonlarga o'tmoqchi emasmanu, kimga qanaqa lekin men halol ovqatlarni afzal ko'raman. Bu yerda halol ovqatlar optioni ko'p emas, lekin yo'g'ammas. Street foodlarda bor, restoranlarda bor. Narxlari lekin salgina qimmatroqdek, balki menga shunday tuyular. Tushlik uchun 20 funt bu o'rtacha narx, undan arzoni ham tepasi ham bor. — Muzeylar Ularga kirmadim to'g'risi, narxlari £15-20 atrofida. Studentman axir. — Suvenirlar Bu yerda Harry Potter filmidagi Diagon Alley joylashgan. Juda mashhur joy. O'sha yerdan suvenir olmoqchi edim, keyin 2 kun och qolarkanman. Ularni narxi ham £20-25 funtlar atrofida. — Ko'zda tutilmagan boshqa xarajatlar - £12 Tekin joylar - barcha parklar, York Mediaval Walls (devorda yurasiz), Yorkning eski qismi Demak, jami: £90.85 (so'mda tahminan 1mln 450ming) To'g'risi, UK uchun yaxshi narx. Ha, lekin bundan yana £10-15 funtni olib tashlasayam bo'lardi, shunchaki men hali bu joylarni yaxshi bilmaganim, tayyorgarligim bo'lmagani pand berdi. Ammo shundan yaxshi tajriba to'pladim. Shunaqa gaplar. Sayohatnoma: Bagajsiz! — Sayohat qilish uchun chamadon emas, jur’at kerak!

Hashtags

Sayohatnoma: Bagajsiz!

@bagajsiz · Post #77 · 31.01.2025 г., 01:10

#prices Hozir £23 so’mga shunchaki Londondan Parijga borib kelish mumkin. £20 soʻmga Albaniyaga BORIB-QAYTISH! WTF?! Yilning lyuboy paytida Urganchga pulimgayam bilet topolmaydigan men: 😢

Hashtags

Trump's Ear

@trumpsear_tg · Post #2161 · 17.02.2026 г., 17:00

💸🛍 American companies are raising prices again, Levi Strauss, McCormick, Columbia Sportswear and other manufacturers have reported price changes, the Wall Street Journal writes. Popular brands of clothing, electronics, and household goods are reviewing price tags. Economists note that the January increases were generally higher than usual. In some cases, the increase was almost 10 percent. This is the sharpest jump in the cost of goods in the last 12 years. Companies attribute the increase to tariffs, the need to pay higher salaries, and expensive medical insurance. It is predicted that more than half of small business owners will raise prices even more in the coming months. #Inflation#Prices 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #1511 · 16.09.2025 г., 00:01

Prices consumers pay for a variety of goods and services moved higher than expected in August while jobless claims accelerated, providing challenging economic signals for the Federal Reserve before its meeting next week. The consumer price index posted a seasonally adjusted 0.4% increase for the month, the biggest gain since January, putting the annual inflation rate at 2.9%, up 0.2 percentage point from the prior month and the highest reading since January. Economists surveyed by Dow Jones had been looking for respective readings of 0.3% and 2.9%. For the vital core reading that excludes food and energy, the August gain was 0.3%, putting the 12-month figure at 3.1%, both as forecast. Fed officials consider core to be a better gauge of long-run trends. The central bank’s inflation target is 2%. #prices#inflation 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #1444 · 01.09.2025 г., 18:01

Target and Walmart staff say they are being asked to rip price tags from clothing in anticipation of tariff-related price hikes. Social media has been flooded with videos from people claiming to be employees at the retail giants, showing racks of clothing with tags removed. #prices#inflation 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #2327 · 01.04.2026 г., 15:59

The average price of gasoline in the United States exceeded $4 per gallon for the first time since August 2022. Just a month ago, it was $2.98. ⛽️📈 California remains the most expensive state. Prices there have risen to $5.89, and in the cities of San Rafael and Santa Rosa, they have exceeded $6. In Oklahoma, where fuel remains the cheapest in the country, the price has increased by 81 cents in a month. Experts predict an increase in prices. According to Rapidan Energy Group, gasoline could rise to $4.50 to $5 per gallon. They do not expect a decrease until summer and attribute it to the blockade of the Strait of Hormuz, which carries about 20% of the world's oil. ⚠️ #Gasoline#prices 👂More on Trump's Ear ⚠️

International News

@intnewsagency · Post #9377 · 25.04.2026 г., 16:34

Car Wash Prices Surge in Tuapse After "Oil Rains" Following contamination by oil-laden rain, demand for car washes in Tuapse has soared. Vehicles became coated with tough-to-remove resin, requiring special cleaning products. While washes previously cost about 1,000 rubles, prices have now risen to 2,000–3,000 rubles. Owners cite higher expenses for professional shampoos and extra treatments. Is this price hike justified? #Tuapse#carwash#prices#oil The main news of Russia and the world ishere.

Trump's Ear

@trumpsear_tg · Post #1476 · 08.09.2025 г., 17:02

In Los Angeles, people with annual incomes below $ 84,000 were recognized as poor In California, even a six-figure salary no longer guarantees well-being. According to the state Housing Department, in Los Angeles, a single person with an income below $84,850 per year is now classified as low-paid. For a family of three, the threshold is set at $109,050. The reason is the extremely high costs of housing and living in general. Over the past 12 years, about 200,000 apartments with rents of less than $1,000 have disappeared in Los Angeles, and the average house price in the region exceeds $1 million. A similar situation is observed in the counties of San Diego, Orange and Santa Barbara, where the "low income" border has grown to $ 92-98 thousand per year. American financial analysts note that the amount of $100,000, which was previously considered a symbol of success, no longer covers basic expenses in many major US cities. In 25 of the country's 100 largest agglomerations, this income level is not enough even to meet basic needs. #inflation#prices#economy#LA 👂More on Trump's Ear ⚠️

Venture Village Wall 🦄

@venturevillagewall · Post #3855 · 12.01.2025 г., 10:00

Whale Data Not Predictive for Traders Analysts from Presto Research analyzed on-chain whale data and found it doesn't reliably predict trading signals. Although platforms like Whale Alert are popular, major coin price changes often follow large transfers. Their conclusion: while whale deposits lack predictive power, on-chain data remains valuable for blockchain analysis and tracing illicit funds. More details: Forklog News. #Whales#Trading#Crypto#XRP#MarketAnalysis#Blockchain#Prices#PrestoResearch#WhaleAlert#IllicitFunds#CoinPrice#Finance#Tech#AI#VC

Sayohatnoma: Bagajsiz!

@bagajsiz · Post #95 · 04.02.2025 г., 19:27

#content Kanalda postlarni o'qish va topishni osonlashtiruvchi (#) heshteglar #about — biror qiziqarli mavzu haqida yozilgan postlar; #visit — tashriflar haqida; #shock — madaniy shoklar haqida; #prices — albatta, narxlar to'g'risida; #myth — ko'pchilik tomonidan ishoniladigan stereotip va klishelarning rost yoki yo'qligi haqida #motivation — ilhomlantiruvchi postlar #useful – foydali postlar. #UK — Buyuk Britaniya #Iceland — Islandiya #Spain — Ispaniya #Hungary — Vengriya #Azerbaijan — Ozarbayjon #Turkiye — Turkiya #Scotland — Shotlandiya #UAE — Birlashgan Arab Amirliklari 🗺Sayohatnoma: Bagajsiz! - Haqiqiy sarguzasht chamadonga sig‘maydi!