medic / cht-conf

A command-line interface for configuring Community Health Toolkit applications
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
23 stars 25 forks source link

Python error when installing pyxform medic on Linux #613

Open kennsippell opened 6 months ago

kennsippell commented 6 months ago

Describe the bug Blocking error when using cht-conf for the first time to deploy a configuration

To Reproduce Steps to reproduce the behavior:

  1. Run npx cht --url=http://medic:password@localhost:5988
  2. User gets this error (expected)
ERROR There was a problem executing xls2xform.  It may not be installed.
E To install the latest pyxform, try one of the following:
E
E Ubuntu
E       sudo python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic
E OSX
E       pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic
E Windows (as Administrator)
E       python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic --upgrade 
  1. Run sudo python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic
  2. User gets an error

Expected behavior Commands provided should not result in error

Logs

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.

    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

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.

Screenshots If applicable, add screenshots to help explain your problem.

Environment

Additional context Run with --break-system-packages