After installer Instagram-scraper with pip3, when I try to run it, it says there's no such command

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"

3

1 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 --version

If 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"
fi

If 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like