Что делать если нужно поставить какую-то 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
#QUICK/USDT analysis :
#QUICK is consolidating sideways within range. Currently price is facing resistance it is expected to revert from there and test swing low support level.
TF : 4H
Entry : $0.02460
Target : $0.02284
SL : $0.02550
#QUICK/USDT analysis :
#QUICK is currently in a bearish trend, consistently forming lower lows (LLs) and lower highs (LHs) below the 200 EMA. The price is consolidating while encountering resistance, and a decline is anticipated from this level, with expectations to test lower price levels.
TF : 30min
Entry : $0.02370
Target : $0.02279
SL : $0.02420
#QUICK/USDT analysis :
#QUICK is in a downtrend, trading below the 200 EMA. The price is currently retracing towards the 200 EMA and a previously respected resistance zone. It is anticipated that the price will test this zone before reverting back to resume its bearish momentum.
TF : 4h
Entry : $0.04420
Target : $0.03600
SL : $0.04895
#QUICK result
2nd target achieved in just 6 hours ✅✅
One more huge quick profit 11.6%🤑💰🤑
👉 Still thinking? The more you wait more you lose profit
☎️ Contact @MichaelStrategiesVip for premium membership and grab next breakout signal
📣 Pump result : The pump didn't go as we expected, and for that, we deeply regret any disappointment caused to our community. This time our efforts led to a peak of 100% profit. While this is a positive result, it's not up to the high standards we set for ourselves and for you. We encountered an "iceberg" coin, presenting us with unexpected and relentless sell orders, which significantly impacted our strategy.
In addition, we faced external challenges with large on-chain OTC transactions to kucoin accounts creating sell walls below our targets, quickly affecting the coin's momentum. We chose this coin based on its potential for a potential ATH breakout, doing so would've lured thousands of traders to trade the dips alongside our community, aiming to maximize your profits. Unfortunately, this decision didn't yield the results we expected. Our team has tried to keep the price up but was unsuccessful due to the nature of this coin. We invite everyone to take a look at the daily chart to understand more our reasoning behind this pick. Our team had the pure intention of boosting the price up to at least 2000% in this pump for all our members but unfortunately it was impossible on this coin.
In the next pump we will make sure we pick a coin that we know for sure can be pumped to more than 1000%+ and our team will make sure that we will reach that target once again by injecting a massive amount of USDT during the pump after our members had bought already. Our whales will use our own capital to push a coin similar to the mega pump which took place on #QUICK, with that being said we expect another 1000%+ profit signal. Today was a one off result, the amount of factors which could've gone into play today were immeasurable and we apologize once again for the lack of foresight. Next pump we will absolutely make sure that we pick a coin we have experience in and that can definitely be pumped to a high price without facing any issue. Stay tuned for our next announcement!
Pump result : One of the best pumps we have had lately! The volume was around 2 million $ with a peak of almost 1500% exactly 6 minutes after the signal was given which is very impressive. The signal on #QUICK was announced and the price started to steadily rise 400%, and with the help of our whales and our big influence the price managed to climb to a whopping 1500% just a few minutes later meaning that everyone that had bought within the first 7 minutes made a massive amount of profits. There were several waves to profit from during the pump, and we're glad to hear so many of you managed to earn alot today.
#QUICK is still sitting at over 500% over an hour later, we promised you guys a special pump to end this year off and we did exactly that! Our signals will keep getting better because our community is growing massively! With our current calculations we are expecting at least 100k new members by the start of the next pump which we will try to surpass a 2000% profit target. Our power is starting to get uncontrollably huge and we thank you guys for trusting us all this time, we appreciate each and everyone of you and hope you and will continue to do what we do best. Stay tuned for the next one as it is going to be even bigger. Our team will make sure to deliver the biggest pumps we have ever seen starting in 2024. Happy holidays everyone.
💥HOW TO WIN YOUR CRUSH 💥
Part 4
📌 Be flirtatious
One of the easiest ways to let him know you’re interested is by flirting. Though this may not be the initial approach you want to take in your texts, once you feel comfortable flirting with him, make sure you do so in a fun, exciting way—without giving away your feelings too much.
The trick is to not make him think that you’re crazy about him, because you don’t want to overwhelm him or make him feel
smothered. Finding the right balance will have him feeling excited to talk to you and curious about your feelings for him. He’ll also be impressed by your confidence.
An easy way to flirt with someone without coming off too strong is by teasing them. Again, be careful not to take this overboard or he may start to consider you as “one of the guys”. Use winking emoticons and make cute innuendos to let him know that you’re excited to see him or to hint that things may get hot and steamy
when you do.
#Quick Tip: If you already have a texting relationship, sending a sweet text saying, “Hope you’re having a great day!” or, “Thinking of you :)” will cheer him up and keep you on his mind. Since most guys have a positive reaction to the word “great” it’s a helpful word to use. More on this later.
📣 Pump result : The pump didn't go as we expected, and for that, we deeply regret any disappointment caused to our community. This time our efforts led to a peak of 100% profit. While this is a positive result, it's not up to the high standards we set for ourselves and for you. We encountered an "iceberg" coin, presenting us with unexpected and relentless sell orders, which significantly impacted our strategy.
In addition, we faced external challenges with large on-chain OTC transactions to kucoin accounts creating sell walls below our targets, quickly affecting the coin's momentum. We chose this coin based on its potential for a potential ATH breakout, doing so would've lured thousands of traders to trade the dips alongside our community, aiming to maximize your profits. Unfortunately, this decision didn't yield the results we expected. Our team has tried to keep the price up but was unsuccessful due to the nature of this coin. We invite everyone to take a look at the daily chart to understand more our reasoning behind this pick. Our team had the pure intention of boosting the price up to at least 2000% in this pump for all our members but unfortunately it was impossible on this coin.
In the next pump we will make sure we pick a coin that we know for sure can be pumped to more than 1000%+ and our team will make sure that we will reach that target once again by injecting a massive amount of USDT during the pump after our members had bought already. Our whales will use our own capital to push a coin similar to the mega pump which took place on #QUICK, with that being said we expect another 1000%+ profit signal. Today was a one off result, the amount of factors which could've gone into play today were immeasurable and we apologize once again for the lack of foresight. Next pump we will absolutely make sure that we pick a coin we have experience in and that can definitely be pumped to a high price without facing any issue. Stay tuned for our next announcement!
Pump result : One of the best pumps we have had lately! The volume was around 2 million $ with a peak of almost 1500% exactly 6 minutes after the signal was given which is very impressive. The signal on #QUICK was announced and the price started to steadily rise 400%, and with the help of our whales and our big influence the price managed to climb to a whopping 1500% just a few minutes later meaning that everyone that had bought within the first 7 minutes made a massive amount of profits. There were several waves to profit from during the pump, and we're glad to hear so many of you managed to earn alot today.
#QUICK is still sitting at over 500% over an hour later, we promised you guys a special pump to end this year off and we did exactly that! Our signals will keep getting better because our community is growing massively! With our current calculations we are expecting at least 100k new members by the start of the next pump which we will try to surpass a 2000% profit target. Our power is starting to get uncontrollably huge and we thank you guys for trusting us all this time, we appreciate each and everyone of you and hope you and will continue to do what we do best. Stay tuned for the next one as it is going to be even bigger. Our team will make sure to deliver the biggest pumps we have ever seen starting in 2024. Happy holidays everyone.