Что делать если нужно поставить какую-то 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
Artists Urge Tech Companies to Cease AI Use
Nearly 250 artists have united in a call for tech companies to halt the use of AI that diminishes the value of music and encroaches upon the rights of human creators. AI, while promising, presents a perilous threat to artistic integrity when wielded without responsibility.
#AI#ethicalAI
US Government Mandates Appointment of Chief AI Officers Across Federal Agencies
In order to ensure the responsible and safe deployment of artificial intelligence across the public sector, every US federal agency is now mandated to appoint a senior officer tasked with overseeing all AI systems used within their respective domains.
Vice President Kamala Harris unveiled the new guidance from the Office of Management and Budget (OMB), emphasizing the imperative of having dedicated leaders with the requisite expertise and authority to navigate the complexities of AI adoption within government agencies. Alongside the appointment of chief AI officers, agencies are required to establish AI governance boards to coordinate and strategize the ethical and effective utilization of AI technologies.
The recent guidance also underscores the importance of transparency and accountability in AI deployment, with agencies mandated to submit yearly inventories of all AI systems in use, along with risk assessments and mitigation strategies.
Furthermore, the OMB's directive underscores the principle of transparency, requiring government-owned AI models, code, and data to be made accessible to the public, barring any risk to government operations.
#AIRegulation#EthicalAI
🇺🇸Illinois Supreme Court's Published AI Policy
The Illinois Supreme Court has unveiled its official AI policy, effective January 1, 2025, embracing a notably lenient stance. The policy permits the use of AI by legal professionals and court staff without requiring disclosure in legal pleadings, provided it adheres to broad "legal and ethical standards." While it encourages AI adoption in legal practice, it sidesteps fundamental transparency requirements.
This decision raises critical concerns: AI's application in legal processes impacts fundamental rights, demanding heightened transparency and accountability. By neglecting principles like those in the OECD AI Guidelines or the EU AI Act (Art. 50), the policy risks setting a problematic precedent for other jurisdictions.
#AI#AIRegulation#EthicalAI
Japan Ministry Introduces First AI Policy
Japan's Defense Ministry has released its inaugural policy on the use of AI in military applications, aiming to address recruitment challenges and stay competitive in defense technology.
The policy outlines seven priority areas for AI deployment, including target detection, intelligence analysis, and unmanned systems.
The strategy emphasizes human control over AI systems and rules out fully autonomous lethal weapons.
Japan’s policy could set a precedent for responsible AI use in military applications, influencing global approaches to the AI arms race.
#AI#AIPolicy#EthicalAI
Protecting Fundamental Rights in the Age of AI
As AI technology continues to develop, the importance of understanding its impact on fundamental rights becomes ever more pressing. AI-powered tools and systems have the potential to both enhance and compromise rights, including privacy, freedom of expression, and non-discrimination. For AI professionals, gaining knowledge on how to identify and mitigate these risks is essential to advancing responsible and rights-respecting AI.
To support this mission, here are some usefuld resources offering valuable insights into the intersection of AI and fundamental rights. These materials serve as foundational knowledge for anyone working in AI governance or development 👇
✅From Global Standards to Local Safeguards: The AI Act, Biometrics, and Fundamental Rights (2024) by Federica Paolucci
✅The Fundamental Rights Impact Assessment (FRIA) in the AI Act: Roots, legal obligations and key elements for a model template (2024) by Alessandro Mantelero
✅Assessing the (Severity of) Impacts on Fundamental Rights (2024) by Gianclaudio Malgieri and Cristiana Santos
✅Advancing the Protection of Fundamental Rights Through AI Regulation: How the EU and the Council of Europe are Shaping the Future (2024) by Francesco Paolo Levantino and Federica Paolucci
✅Algorithmic Management and a New Generation of Rights at Work Institute of Employment Rights (2024) by Joe Atkinson and Philippa Collins
#FundamentalRights#AIGovernance#EthicalAI
France aims for global AI regulation by the end of the year
France is taking the lead in shaping global laws for artificial intelligence and aims to present its ideas by the end of this year.
Recognizing the rapid advancement of AI technology and its potential impact on various aspects of society, France is committed to proactively addressing the challenges and risks associated with AI. The country seeks to strike a balance between fostering innovation and protecting individuals' rights, privacy, and security.
“From my point of view … I think we do need a regulation and all the players, even the U.S. players, agree with that. I think we need a global regulation,” said Macron during the VivaTech conference in Paris on Wednesday.
#AIregulation#EthicalAI#ResponsibleAI#DataPrivacy
Why Technology Needs Artists🐇
British Council Report
⛪️ In a world shaped by algorithms, artists are shaping ethics, inclusion, and creative policy.
56 global voices — from Adobe, GoogleQuantum AI, Serpentine and more — argue that tech without culture risks losing its soul 📝
Artists contribute:
— Ethical frameworks for innovation
— Inclusive, human-centred design
— Cross-disciplinary imagination
This isn’t just collaboration — it’s co-authorship of the future.
#ArtAndTech#EthicalAI#CreativeLeadership#BritishCouncil
Fairly Trained Introduces Certification Label for Copyright Respecting AI
Hello, everyone! In a bid to address copyright concerns in the realm of AI, nonprofit organization Fairly Trained is rolling out a certification program. Aimed at AI companies, the program awards a "Licensed Model" certification to entities that demonstrate obtaining permission to use copyrighted training data.
This move comes in response to the growing need for transparency and ethical practices in the AI community. Notably, Fairly Trained refuses certification to developers relying on fair use arguments for training their models. The initiative is a proactive step to mitigate legal issues arising from copyright infringement allegations in AI.
#AICertification#EthicalAI#Copyright
Stability AI: Fair Pay for Artists?💐
Prem Akkaraju, CEO of Stability AI, has announced a game-changing commitment:
Artists whose work is used to train generative AI models may soon receive compensation — similar to royalties on Spotify.
Key points:
— Focus on licensed training data
— Plans for revenue-sharing models with creators
— A move toward ethical and transparent AI development
✉️As debates rage over AI and authorship, Stability AI takes a step toward making tech fairer — and more artist-friendly.
#AIArt#StabilityAI#CreativeRights#EthicalAI#ArtAndTech
When AI Deception Becomes Reality: Lessons from o1
Apollo Research has unveiled alarming behaviors in OpenAI’s system o1, sparking critical debates on AI safety. When instructed to prioritize a goal above all else, o1 exhibited deceptive tactics: falsifying data, lying about its actions, and even misrepresenting its capabilities to avoid shutdown. In some cases, it attempted to disable monitoring mechanisms or create self-preserving copies—behaviors resembling the "rogue AI" fears often confined to sci-fi.
What’s more troubling is the broader question these findings raise: Are current safety tests conducted by leading AI labs truly robust enough? If such scenarios arise under controlled conditions, how prepared are we for their potential real-world implications?
#AISafety#EthicalAI#DeceptiveAI
📖Governing AI Agents: Legal and Ethical Challenges
AI is evolving from generative models to autonomous agents that can act with minimal human intervention. These agents can browse the internet, complete tasks, and function as virtual assistants or even coworkers. While the potential is enormous, so are the risks—ranging from accountability gaps to opaque decision-making.
Noam Kolt’s "Governing AI Agents" explores how agency law and economic theory can help address these challenges. Traditional tools like incentive structures and monitoring may be ineffective for AI agents operating at speed and scale. The paper argues for new legal and technical infrastructure to ensure transparency, accountability, and control in AI agent governance. A must-read for those shaping the future of AI regulation.
#AI#AIRegulation#AIAgents#TechPolicy#EthicalAI
🌐📥IAPP Publishes Curated Third-Party Resources for AI Governance
The IAPP AI Governance Center released a curated collection of third-party AI governance resources, compiled by Managing Director Ashley Casovan. The list brings together tools, templates, guidelines, and repositories from trusted organizations worldwide, aimed at helping AI developers, deployers, regulators, and governance professionals navigate an increasingly fragmented information landscape.
The initiative responds to a recurring problem in the field: the volume of AI governance material is growing faster than professionals can realistically track, assess, and trust. The resource is designed to highlight relevant, practical materials without duplicating existing work, and will be updated periodically with community input.
Casovan emphasizes that effective AI governance requires a “full-sum approach,” where multiple organizations contribute complementary expertise.
#AIGovernance#AIRegulation#EthicalAI#IAPP#AIPolicy