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

Резултати

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

Пребарај: #facialrecognition

当前筛选 #facialrecognition清除筛选
AI & Law

@ai_and_law · Post #334 · 19.06.2024 г., 07:04

Indiana Officer Resigns After Misusing Clearview AI An Indiana police officer has resigned after it was discovered he frequently misused Clearview AI’s facial recognition technology to track social media users not linked to any crimes. According to the Evansville Police Department, the officer disguised personal searches by using actual case numbers associated with real incidents. An audit revealed an unusual high usage of Clearview AI by the officer, who primarily searched social media images rather than live or CCTV footage typically used in investigations. The department recommended termination, but the officer resigned before a final determination could be made. This incident highlights significant concerns about the misuse of facial recognition technology and underscores the need for stricter oversight and compliance measures to prevent abuse. #AI#Privacy#FacialRecognition#ClearviewAI

AI & Law

@ai_and_law · Post #335 · 20.06.2024 г., 07:04

Clearview AI Agrees to Conditional Settlement in Privacy Lawsuit Clearview AI has reached a unique settlement agreement in a privacy lawsuit involving its data-scraping facial recognition technology. Unable to afford immediate compensation, Clearview AI will establish a fund representing 23% of the company's value as of last September. This fund will only be activated if the company undergoes an IPO or a significant event like a merger or asset sale. Based on Clearview's current valuation, this fund could be worth up to $51.7 million. The settlement, awaiting final court approval, also includes appointing a special master to demand cash from Clearview or sell settlement rights to third parties, with proceeds going to class members. Clearview AI has faced multiple lawsuits accusing it of privacy violations, leading to this creative resolution. The company, burdened by mounting legal costs, agreed to this settlement to avoid bankruptcy and provide potential relief to affected individuals. #Privacy#AI#ClearviewAI#FacialRecognition#LegalTech

AI & Law

@ai_and_law · Post #222 · 23.01.2024 г., 08:04

Controversial Changes to EU's AI Act Allow Facial Recognition Without Judicial Approval Hello, everyone! Recent alterations to the AI Act, initially endorsed in December, are stirring controversy as they permit law enforcement to employ facial recognition on recorded video without judicial consent. German MEP Svenja Hahn decries these last-minute changes, asserting that they undermine civil rights and draw parallels with practices in authoritarian states. The revisions, concluded on December 22, diverge from the initial agreement, which mandated stricter conditions and judicial oversight for facial recognition use. Critics express concerns about post-facial recognition technology, emphasizing the need for clarity on privacy and oversight. The final text faces scrutiny on January 24, with potential amendments requiring further legislative attention. #FacialRecognition#AIAct#EuropeanUnion#CivilRights#PrivacyConcerns

AI & Law

@ai_and_law · Post #200 · 26.12.2023 г., 08:04

FTC bans Rite Aid from using AI facial recognition in stores for 5 years Hello everybody! The US Federal Trade Commission (FTC) has barred American drugstore giant Rite Aid from utilizing AI facial recognition technology for surveillance purposes over the next five years. The FTC intervened as Rite Aid allegedly "failed to implement reasonable procedures" in deploying facial recognition across 200 stores over eight years. Rite Aid's facial recognition system, designed to identify past shoplifters, resulted in numerous false positives. Tens of thousands of individuals were included, often with low-quality images from various sources, leading to unwarranted confrontations and police interventions, disproportionately impacting people of color. Rite Aid is mandated to delete collected images, algorithms, and related products, notify consumers, enhance data security measures, and provide clear notices regarding any biometric surveillance technology in stores. Rite Aid, while agreeing to the FTC settlement, expressed fundamental disagreement with the facial recognition allegations. The company halted the technology's use three years prior to the FTC investigation and commits to fortifying information security practices. #AILaw#PrivacyRights#FacialRecognition#FTC#RiteAid#LegalTech

MessageInABottle

@mib_messageinabottle · Post #6953 · 26.05.2024 г., 12:59

🇬🇧#UK #PreCrime "I WAS MISIDENTIFIED AS SHOPLIFTER BY FACIAL RECOGNITION TECH" Sara needed some chocolate - she had had one of those days - so wandered into a #HomeBargains store. "Within less than a minute, I'm approached by a store worker who comes up to me and says, 'You're a thief, you need to leave the store'." Sara - who wants to remain anonymous - was wrongly accused after being flagged by a facial-recognition system called #Facewatch. She says after her bag was searched she was led out of the shop, and told she was banned from all stores using the technology. Facewatch later wrote to Sara and acknowledged it had made an error. The #MetropolitanPolice in #London say that around one in every 33,000 people who walk by its cameras is misidentified. But the error count is much higher once someone is actually flagged. One in 40 alerts so far this year has been a false positive #AI #FacialRecognition