dlenski / vpn-slice

vpnc-script replacement for easy and secure split-tunnel VPN setup
GNU General Public License v3.0
721 stars 86 forks source link

LInux Mint 22 and vpn-slice #152

Closed mebigfatguy closed 2 weeks ago

mebigfatguy commented 2 weeks ago

I've just upgraded to 22 of mint, and

sudo pip3 install "vpn-slice[dnspython,setproctitle]"

produces

error: externally-managed-environment

× This environment is externally managed

So i tried using pipx

sudo pipx install "vpn-slice[dnspython,setproctitle]"

which seemed to work, however, when i do

sudo vpn-slice --self-test

i get

Traceback (most recent call last): File "/usr/local/bin/vpn-slice", line 5, in from vpn_slice.main import main ModuleNotFoundError: No module named 'vpn_slice'

Anyone know how to resolve this?

gmacon commented 2 weeks ago

Yeah, that first "externally managed" error is telling you that it's not supported to install packages into the global Python environment with pip if that global environment is managed by some other package manager (APT in this case). I would expect using pipx to work, though I'm surprised that the binary ended up in /usr/local/bin, I would have expected /root/.local/share/pipx/venvs/vpn-slice/bin/vpn-slice or so. Can you try sudo pipx uninstall vpn-slice and see if /usr/local/bin/vpn-slice still exists? If so, you need to get rid of it by undoing whatever you did to put it there in the first place and then try pipx again.

mebigfatguy commented 2 weeks ago

vpn-slice was in fact in /usr/local/bin, so i ran

sudo pipx uninstall vpn-slice

and removed that directory. then ran

sudo pipx install "vpn-slice[dnspython,setproctitle]"

which produces

installed package vpn-slice 0.16.1, installed using Python 3.12.3 These apps are now globally available

then i ran

pipx ensurepath

which produced

/home/dave/.local/bin is already in PATH.

⚠️ All pipx binary directories have been added to PATH. If you are sure you want to proceed, try again with the '--force' flag.

Otherwise pipx is ready to go! ✨ 🌟 ✨

There is nothing in ~/.local/bin

vpn-slice is also now NOT in /usr/local/bin

~/.local/share/pipx/venvs/ is also empty

-- same error

gmacon commented 2 weeks ago

You would need to run sudo pipx ensurepath since pipx works per-user. However, I would guess (but haven't checked) that openconnect doesn't invoke a shell to run the script, you now just need to provide the fully-qualified path (/root/.local/bin/vpn-slice) to openconnect.

mebigfatguy commented 2 weeks ago

thank you very much, specifying the full path when running open connect worked.