1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「ハッキングラボのつくりかた 完全版」droopescanのインストールでエラーが出た件

Posted at

問題

「ハッキングラボのつくりかた 完全版」DC1の攻略時、以下のコードでインストールエラーが発生した。

pip install droopescan

エラー内容

┌─[user@parrot]─[~]
└──╼ $sudo pip install droopescan
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

調査したこと

1:エラー文を翻訳
2:"pip externally-managed-environment"でググった

解決方法

以下のコードで仮想環境にインストールする

python3 -m venv myenv # 仮想環境を作成
source myenv/bin/activate #仮想環境を有効化
pip install droopescan # droopescanのインストール

終わりに

最初は"apt install droopescan"をしたがインストールできず..
パッケージ化されていないからそもそもapt installが使えないという当たり前のことを今更ながら認識した。
また、pipxを使う方法も書かれていたがエラーの前半しか読んでいなかったため、試す前に解決してしまった。
解決後pipxをインストールしたがdroopescanのインストールで別のエラーが出た。そちらは"pip drooopescan"でググればすぐに解決手順が出てきた。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?