6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

エラー対処:Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted

Last updated at Posted at 2018-08-25

Ansibleをインストールしようとして出たエラーの対処法メモ

$ sudo pip3 install ansible
...
Collecting MarkupSafe>=0.23 (from jinja2->ansible)
Collecting pycparser (from cffi!=1.11.3,>=1.7->cryptography->ansible)
Installing collected packages: pycparser, cffi, six, idna, asn1crypto, cryptography, bcrypt, pynacl, pyasn1, paramiko, PyYAML, MarkupSafe, jinja2, ansible
Could not install packages due to an EnvironmentError: [Errno 1] Operation not permitted: '/bin/ansible-console'

どうやら /bin 以下にはsudoでもファイルが置けない模様。
そこでpipに --user オプションをつけてインストール場所をかえる。

pip3 install ansible --user

私のMac環境だと/Users/paper2/Library/Python/3.7/binにインストールされていたのでパスを通してインストール完了。

ちなみにパスの確認方法は以下

$ pip3 show ansible
Name: ansible
Version: 2.6.3
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /Users/XXXX/Library/Python/3.7/lib/python/site-packages
Requires: paramiko, setuptools, cryptography, jinja2, PyYAML
Required-by:
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?