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

Резултати

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

Пребарај: #lyft

当前筛选 #lyft清除筛选
СОЛОДИН LIVE

@goodtraders · Post #9250 · 17.09.2025 г., 14:29

#LYFT LYFT начал пробивать сопротивление - цена выросла почти +80% за месяц - поздравляю всех, кто участвовал в этом ралли. Что дальше? Ну скорее всего где-то откатит, так как пробитый уровень нужно тестировать = но долгосрочная картина пока бычья.

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1750 · 11.03.2019 г., 11:00

🛴Americans drift from Uber and Lyft, test alternative forms of transportation Americans are exploring alternative methods of transportation. Looking at average daily active users (DAUs) per month over the past 13 months, we’re estimating decreases in active usage for #Uber and #Lyft, while seeing increases in active usage for things like public transportation, bikes and scooters. The above data is for the United States and is a combination of iOS + Google Play apps. Lyft has said its market share in the United States was at about 35% in early 2018, and is now closing in at around 40%. Lyft is losing less average DAUs than Uber, which has in fact grown its percentage of market share in the United States. Read more on Apptopia. 🚀@PerspectiveIX

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1741 · 04.03.2019 г., 10:30

🚖 Lyft Closing New User Gap with Uber in U.S. as IPO Approaches As it prepares for its long-awaited IPO, #Lyft has been slowly yet surely pulling alongside rival #Uber in the United States when it comes to the number of new users both services are adding each month. According to Sensor Tower, which count first-time downloads of apps by unique App Store and Google Play users, Lyft added close to 1.5 million new riders in the U.S. last month, compared to Uber’s 1.9 million, giving the soon-to-be-public company a 43 percent share of those acquired between the two. This is a significant turnaround from April 2015, when Uber accounted for 82 percent of new U.S. riders added by the two services that month. Read more on SensorTower. 🚀@PerspectiveIX

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1717 · 05.02.2019 г., 18:30

🚕Uber vs. Lyft: Loyalty Edition Ride-sharing customers are becoming less loyal. Americans who used both #Uber and #Lyft in the last quarter of 2018 accounted for about a third of the companies’ ride-sharing revenue, according to new data from Earnest Research. That’s up 13 percentage points from the beginning of 2016. 🚀@PerspectiveIX via Recode.

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1702 · 17.12.2018 г., 10:30

🚕Lyft has eaten into Uber’s U.S. market share #Uber controls the majority of U.S. ride-hailing but #Lyft is growing twice as fast. And both plan to go public in early 2019. 🚀@PerspectiveIX via Recode.

Hashtags

🚗Lyft продаст свое подразделение по производству беспилотных автомобилей подразделению Toyota за $550 млн. В рамках сделки компании будут работать вместе над повышением безопасности технологий автоматизированного вождения. 📈 Президент Lyft сказал, соглашение позволит им сосредоточиться на продвижении своей автономной платформы и транспортной сети, а также сократить убытки. На фоне заявления о продаже подразделения, акции Lyft выросли более чем на 2%. #США#Lyft#Toyota

🦅 [ perspective ix ]

@perspectiveix · Post #1563 · 25.09.2018 г., 08:00

​​💰Gig Economy Workers Are Earning Half What They Did Five Years Ago More people are working for ride-sharing and delivery companies but on average they’re making less. On average, drivers who transport people (#Uber or #Lyft) or things (#UberEats or #Postmates) through an app made 53 percent less in 2017 than they did in 2013, according to a new study by the JPMorgan Chase Institute. The average monthly payments to those who worked for a transportation app in a given month declined to $783 from $1,469. Meanwhile, people working for leasing apps — #Airbnb, Turo, Parklee and other apps that let you rent assets like your home, car or parking space — saw their incomes from those platforms rise 69 percent to $1,736 on average. This is happening as online gig work has become more popular, thanks in large part to the growth in the number transportation jobs. 🚀@PerspectiveIX via Recode.

🦅 [ perspective ix ]

@perspectiveix · Post #1848 · 18.06.2019 г., 10:30

​​💰Libra: Facebook confirms its cryptocurrency launching in 2020 #Libra is designed not to be a speculative asset, like #Bitcoin, but a form of digital money backed by a reserve of assets. The company has formed the nonprofit Libra Association with 27 other partners to oversee Libra and its development. The partnership includes venture capital firms, nonprofit organizations, #cryptocurrency firms, and massive corporate financial, telecommunications, and technology service providers, including #Coinbase, #Mastercard, #Visa, #eBay, #PayPal, #Stripe, #Spotify, #Uber, #Lyft, and #Vodafone. While the Libra Association will have members based globally, it will be headquartered in Geneva, Switzerland🇨🇭 Facebook has a business incentive to build on top of the Libra #blockchain, and it’s launching its own subsidiary to do just that called #Calibra (see the GIF below - Credit: Facebook). According to Kevin Weil, Facebook's VP of Product, Calibra will live inside of Facebook Messenger and WhatsApp at launch, but will also have a standalone iOS and Android app. 🔗 Read more the Verge. 🚀@PerspectiveIX