I installed python 3 and pip3 into in Windows System for Linux shell that uses Ubuntu, but it appears I have to find and specify site-packages or $HOME/.local/bin directory manually if I want to run any python package executables.
The package I want to use is cheat, but the problem is the same for any other package.
My chain of commands was:
- install WSL - Ubuntu 18.04
sudo apt-get update(becausesudo apt-get install pip3will not work on fresh installation)sudo apt-get -y install python3-pip(installs python too) - editedsudo pip3 install cheatcheatnot recognised as a command, whilepython3runs fine from/usr/bin/python3find locations where
cheatis found, they are:$HOME/.local/bin/cheat $HOME/.local/lib/python3.6/site-packages/cheatWhen I add any of these directories to path, I'm able to run python executables,
cheat lsworks.
Is there something I can change in the installation process so that I mustn't search for directories and add them manually to path?
~/.local/binis where pip usually installs executables for user-installation. You only need to know that once, there's no need to search for the location again and again. – muru Sep 27 '18 at 21:59~/.local/binto find out where the executable is, if he has no prior knowledge of pip behaviour. On Windows executables work right after pip install, no searching needed. – Evgeny Sep 28 '18 at 05:52sudo pip3 install cheatstill installs to a user home directory. – Evgeny Sep 28 '18 at 05:53/usr/local/bin, which is in PATH. – muru Sep 28 '18 at 06:05sudodoes install at/usr/local/bin/cheatand local directories installation emerges when doing pip with nosudo. – Evgeny Sep 29 '18 at 06:32python -m modulename. That'll search for modules in their respective paths. But depends on how module is built. – Sergiy Kolodyazhnyy Sep 29 '18 at 06:40python -mis a good idea, I sometimes invokepytestlike this to persist a start folder, but for cheat specifically it is doesnt work. – Evgeny Sep 29 '18 at 20:38