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.12/README.venv for more information.

pip install ipython을 하려고 하니까 위와 같은 에러가 나왔다.  아래 코드를 시도해보고 안되면 아래 순서대로 하기

sudo apt install ipython3

 

 

1. 가상환경에서 ipython을 설치해줬다.

python3 -m venv .venv
sudo apt install python3.12-venv  (생략해도 됨)

2. 가상환경을 활성화 해준 후 다운 받고 가상환경에서 빠져나오기

source .venv/bin/activate
python3 -m pip install ipython
 deactivate

3. 작동되는지 확인

ipython 
ipython3

+ Recent posts