3

I'm trying to install speedtest-cli with pip and I'm getting errors that speedtest-cli is not intalled.


ubuntu@vostro:~$ pip install --user speedtest-cli
Collecting speedtest-cli
  Using cached https://files.pythonhosted.org/packages/61/8b/58d1de9a7fff3e91c5ab956ab4ba72b49f42d9f73d5f3e248c740dfcc816/speedtest_cli-2.1.1-py2.py3-none-any.whl
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-2.1.1
ubuntu@vostro:~$ speedtest-cli
-bash: /usr/bin/speedtest-cli: No such file or directory

But speedtest-cli is correctly installed in /home/ubuntu/.local/lib/python2.7/site-packages and I can run it by doing python speedtest.py on that folder.

All those folders belong to the user ubuntu, but something I think is wrong is that the py and pyc files are not executable. (They weren't by default, I didn't change anything)

ubuntu@vostro:~/.local/lib/python2.7/site-packages$ ll
total 132K
drwxrwxr-x 2 ubuntu ubuntu 4,0K jun 02 2019 23:55 speedtest_cli-2.1.1.dist-info
-rw-rw-r-- 1 ubuntu ubuntu 1,2K jun 02 2019 23:55 speedtest_cli.py
-rw-rw-r-- 1 ubuntu ubuntu  62K jun 02 2019 23:55 speedtest.py
-rw-rw-r-- 1 ubuntu ubuntu  590 jun 02 2019 23:55 speedtest_cli.pyc
-rw-rw-r-- 1 ubuntu ubuntu  56K jun 02 2019 23:55 speedtest.pyc

And this is the output of python -m site

ubuntu@vostro:~/.local/lib/python2.7/site-packages$ python -m site
sys.path = [
    '/home/ubuntu/.local/lib/python2.7/site-packages',
    '/usr/lib/python2.7',
    '/usr/lib/python2.7/plat-x86_64-linux-gnu',
    '/usr/lib/python2.7/lib-tk',
    '/usr/lib/python2.7/lib-old',
    '/usr/lib/python2.7/lib-dynload',
    '/usr/local/lib/python2.7/dist-packages',
    '/usr/lib/python2.7/dist-packages',
]
USER_BASE: '/home/ubuntu/.local' (exists)
USER_SITE: '/home/ubuntu/.local/lib/python2.7/site-packages' (exists)
ENABLE_USER_SITE: True

I think the problem is related to the env properties, but looking at that output I'm not so sure anymore.

Deses
  • 172

1 Answers1

4

You have moved from a system wide installation to a localized user installation of the application within the same terminal session without it updating its environment.

Your terminal is remembering the system wide installation path at /usr/bin/... and trying to run that.

You will need to close the terminal session and reconnect to obtain a fresh environment and $PATH contents.

(If there's a better way to do this directly from the command line, I'd love to know.)

SHawarden
  • 885