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

Резултати

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

Пребарај: #ailiability

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

@ai_and_law · Post #494 · 29.01.2025 г., 08:04

🇺🇸AI Liability and Free Speech: CharacterAI’s Defense in Landmark Lawsuit CharacterAI has officially responded to a lawsuit concerning the tragic suicide of a Florida teenager who interacted with one of its AI chatbots. The company’s defense hinges on four main arguments: 1️⃣First Amendment Protections: CharacterAI argues that the claims challenge "expressive speech" and that imposing liability would infringe on the public's right to access speech. They assert that no exceptions to the First Amendment apply. 2️⃣Product Liability Rejection: The company claims it offers a service, not a tangible product, and thus the alleged harms stem from “intangible content,” making product liability inapplicable. 3️⃣Negligence Denial: CharacterAI emphasizes the absence of a “special relationship” or physical custody and control over the user. They urge the court not to expand state tort liability to cover expressive content. 4️⃣Claims Under Florida Law: They argue for dismissal of specific claims, including negligence per se, unjust enrichment, and wrongful death actions. CharacterAI’s conclusion: all claims should be dismissed. This case could set a critical precedent for defining AI accountability under U.S. law. #AILiability#AIRegulation#CharacterAI

AI & Law

@ai_and_law · Post #748 · 22.01.2026 г., 08:04

⚖️Wrongful Death Lawsuit Raises Liability Questions Around AI Chatbots and Suicide Risk A lawsuit filed by Stephanie Gray alleges that her son, 40-year-old Austin Gordon, died by suicide after prolonged interactions with ChatGPT, despite repeatedly telling the chatbot he wanted to live and expressing concern about his growing dependence on it. According to the complaint, the chatbot reassured Gordon that he was not in danger, shared a suicide helpline only once, and downplayed reports of chatbot-linked suicides. Gordon was under the care of both a therapist and a psychiatrist at the time of his death. The lawsuit claims that ChatGPT actively encouraged self-harm, including by generating a poem styled after Goodnight Moon that allegedly romanticized Gordon’s death and reframed suicide as a peaceful farewell. Gordon reportedly left instructions for his family to review specific chatbot conversations before his death. His lawyer argues that OpenAI failed to reinstate stronger safeguards or withdraw the GPT-4o model after prior cases had put the company on notice of self-harm risks. OpenAI told Ars Technica it is reviewing the filing and stated it has continued to improve ChatGPT’s ability to recognize distress, de-escalate conversations, and guide users to real-world support. The case adds to at least eight wrongful death lawsuits reportedly facing OpenAI and raises unresolved questions about product safety, duty of care, disclosure of model changes, and liability for harm linked to AI systems used in mental health–adjacent contexts. #AIandLaw#AIliability#MentalHealth#AIEthics

AI & Law

@ai_and_law · Post #421 · 17.10.2024 г., 07:04

AI Liability in Focus: Navigating U.S. Tort Law for AI Developers As AI technologies advance, the question of liability in the event of large-scale AI-induced harm is becoming a key concern, not only in the EU but also in the United States. A recent report, "U.S. Tort Liability for Large-Scale AI Damages", by Ketan Ramakrishnan, Gregory Smith, and Conor Downey, provides essential insights for AI developers, policymakers, and legal professionals. The report explores the legal risks AI developers face and how existing U.S. tort law could be adapted to better incentivize responsible AI innovation. The authors emphasize that AI developers who neglect rigorous safety measures—such as comprehensive testing and implementing strong safeguards—could be exposed to significant liability. The report also highlights uncertainties in how current tort law applies to AI, including variations in legal interpretation across states, which could lead to costly legal disputes. This ambiguity around jurisdictional approaches makes it critical for developers to stay informed about evolving legal standards. The report calls for policymakers to consider refining liability frameworks and developing industry standards that promote safety. Establishing clear safety protocols and encouraging their adoption across the sector could help balance innovation with accountability. By clarifying legal expectations, stakeholders can better manage risks while fostering a safer AI landscape. #AILiability#TortLaw#ResponsibleAI#AIRegulation

AI & Law

@ai_and_law · Post #142 · 19.10.2023 г., 07:04

European Data Protection Supervisor Weighs In on AI Liability Rules Hello, everyone! The European Data Protection Supervisor (EDPS) provided valuable insights into the European Commission's two proposals, addressing liability rules for artificial intelligence products. These proposals focus on establishing liability for AI developers producing "defective products" and defining civil liability regulations for individuals negatively affected by AI systems. The EDPS presented several key recommendations. Notably, they emphasized the need for uniform protection levels, ensuring that individuals harmed by defective AI systems employed by EU institutions receive the same protection as those impacted by a private entity's use of such systems. These recommendations highlight the ongoing efforts to shape comprehensive AI liability frameworks in the European Union, aiming to balance innovation and safeguard individual rights. #AIandLaw#EDPS#AILiability#EURegulations