I am trying to compile xonsh from source however it doesn't seem to recognise xonsh as a command even after build and install

30 Views Asked by At

I am trying to compile xonsh from its git repository, I am using the following commands to install it:

git clone https://github.com/xonsh/xonsh.git

I then change directories into xonsh after cloning the repo, followed by the build and install:

sudo python3 setup.py build

Once I run this, a large but quite impressive text-art shell, a line saying "running build" and then the terminal prompt appears instantly, almost as if it didn't build. Regardless, I ran the following line to install it:

sudo python3 setup.py install

And then it is showing a bunch of install lines with no errors and then it ends with "running install_scripts", then the terminal prompt shows up straight away again.

I have tried using the "xonsh" command, nothing works, it says its not found, nothing i can find in /usr/local/bin or /usr/bin that's related to xonsh.

I have tried using the "xonsh" command, nothing works, it says its not found, nothing i can find in /usr/local/bin or /usr/bin that's related to xonsh. I even tried deleting and re-installing it however no luck there.

Before anyone asks why I dont use pip install xonsh, I am trying to do it via compiling from source, so I will only resort to this if compilation deems impossible. I appreciate any help/advise given :).

1

There are 1 best solutions below

0
Gil Forsyth On

You can still use pip to install a Python package from source (and you should, setup.py usage is deprecated).

If you are in the cloned source directory you can run

pip install . --user

The --user part will install the entry-point (the xonsh executable) in $HOME/.local/bin, so make sure that is part of your $PATH. Generally you want to avoid using sudo with your system python because it can make things go a little screwy.

Most users are better served by the prompt_toolkit-based version, so for that