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

Резултати

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

Пребарај: #gpai

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

@ai_and_law · Post #622 · 28.07.2025 г., 07:04

🇪🇺EU Mandates Transparency on AI Training Data for GPAI The EU has released its official template for the mandatory training data summary required under Article 53(1)(d) of the EU AI Act. Starting August 2, providers of general-purpose AI models must publicly disclose a sufficiently detailed overview of the content used for model training. This includes naming major datasets, public or private, and offering narrative context for other sources, as clarified in Recital 107. This is a structural shift in regulatory expectations. AI developers can no longer obscure data provenance or sidestep questions of copyright and data protection. The summary isn’t just a compliance formality, it’s a mechanism for enforcement. Rights holders and regulators finally gain a clear window into the inputs behind powerful AI systems. #GPAI#EUAIAct

AI & Law

@ai_and_law · Post #457 · 04.12.2024 г., 08:04

Decoding the AI Act: Q&A on General-Purpose AI The AI Office has released a detailed Q&A to clarify critical aspects of the AI Act, focusing on general-purpose AI (GPAI). While emphasizing that only EU Courts can provide definitive interpretations, the document addresses GPAI risks, provider obligations, and compliance requirements. It also sheds light on the role of the General-Purpose AI Code of Practice, including its legal implications, limitations, and specific provisions for startups. Key insights include requirements for open-source models, R&D exemptions, and obligations tied to model fine-tuning. The document outlines enforcement mechanisms and a timeline for finalizing the Code of Practice, stressing its importance as a guide rather than a binding regulation. This Q&A provides essential context for stakeholders navigating the evolving AI regulatory landscape. #AIRegulation#GPAI#AIEthics#AIAct

AI & Law

@ai_and_law · Post #605 · 02.07.2025 г., 07:04

🇪🇺AI Rules Must Serve People, Not Just Platforms: Open Letter to the European Commission A powerful coalition including Nobel laureates Daron Acemoglu and Geoffrey Hinton has called on the European Commission to stay the course on general-purpose AI (GPAI) regulation. In a joint letter to President von der Leyen, researchers, civil society leaders, and industry experts urge EU leaders not to weaken GPAI rules under pressure from tech lobbies. Their message: innovation and rights protection are not mutually exclusive. The signatories back the Code of Practice developed over the past nine months as a pragmatic governance tool — one that applies only to 5–15 major players and mirrors existing risk management norms. They recommend mandatory third-party testing for systemic-risk models, agile review mechanisms, and significant resourcing of the AI Office, including 300 dedicated personnel and top-tier safety expertise. #AIRegulation#GPAI#AIEthics#EUAIAct

AI & Law

@ai_and_law · Post #813 · 24.04.2026 г., 07:04

🇪🇺First Scholarly Commentary Focuses on EU GPAI Rules The Leverhulme Centre for the Future of Intelligence at the University of Cambridge and the Institute for Law & AI have launched the first academic commentary dedicated exclusively to the general-purpose AI (GPAI) model provisions of the EU AI Act. The project addresses regulatory uncertainty surrounding GPAI systems, particularly models that may present systemic risk. Rather than promoting a single interpretation, the commentary analyzes each provision by outlining where the law is clear, where ambiguity remains, and the strongest legal arguments on competing sides. The initiative launches with Chapter V of the AI Act, with additional articles to be released on a rolling basis. #AIRegulation#EUAIAct#GPAI#LegalResearch#AIGovernance

इस हफ्ते का #FridaysAtMyGov लाइव हो चुका है।। 🥳 आइए इस लेटेस्ट एपिसोड में #GPAI शिखर सम्मेलन में नए भारत की एआई के क्षेत्र में बढ़ती ताकत को जानें। अभी देखें पूरा एपिसोड: https://youtu.be/ABfmjdKoz2c?feature=shared #NewIndia#MyGov #GPAISummit

AI & Law

@ai_and_law · Post #617 · 18.07.2025 г., 07:04

🇪🇺 EU AI Act: Voluntary Code, Strategic Signal The EU AI Office is now officially inviting general-purpose AI model providers to sign the General-Purpose AI Code of Practice. Signing is voluntary — but strategic. Companies like OpenAI and Mistral have already committed, signaling alignment with the EU’s emerging regulatory expectations. Signatories gain more than reputational capital: the EU Commission will prioritize monitoring adherence to the code rather than imposing full administrative scrutiny. This approach offers regulatory predictability and reduced compliance burden — a clear incentive ahead of the AI Act’s enforcement starting 2 August 2025. The list of signatories will be published on 1 August 2025. #AIRegulation#EUAIAct#GPAI#AIEthics # #OpenAI#Mistral