I used
pip3 install instagram-scraper
to install instagram scraper and then I used
pip3 list
and I can see Instagram-scraper installed but if I try to check which version, when I type
instagram-scraper --version
it says it can't find a command called "instagram-scraper"
31 Answer
When pip runs as normal user (or with --user, depending on version) it stores executables by default in your ~/.local/bin folder. This location might not be in your $PATH variable yet.
Check if you can run the command as
~/.local/bin/instagram-scraper --versionIf this works, you should make sure this folder is added to your user's $PATH:
Check your ~/.profile file. On modern Ubuntu versions, it should already conditionally add this location to $PATH if it exists when you log in, using a snippet looking like this:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH"
fiIf you don't find such a block in your ~/.profile script, append it to the file and save.
Either way, as this is only checked when you log in, you have to log out and back in now if you just added the snippet or if the directory was just created during this session.
After that, you should see /home/USERNAME/.local/bin as part of the output of echo "$PATH", and instagram-scraper --version should work directly without specifying a directory.