Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: unable to run phyton

  1. #1
    Join Date
    May 2021
    Beans
    4

    unable to run phyton

    Hi all,

    i recently installed ubuntu 20.04 desktop on my laptop. Found out that I can't run any phyton command, says command not found.

    mus@mus-ONYX-G:/etc$ phyton --version
    bash: phyton: command not found
    mus@mus-ONYX-G:/etc$ phyton2 --version
    bash: phyton2: command not found
    mus@mus-ONYX-G:/etc$ phyton3 --version
    bash: phyton3: command not found
    mus@mus-ONYX-G:/etc$ whereis phyton3
    phyton3:
    mus@mus-ONYX-G:/etc$ whereis phyton2
    phyton2:
    mus@mus-ONYX-G:/etc$ whereis phyton
    phyton:
    mus@mus-ONYX-G:/etc$

    but checking /usr/bin phyton existed:

    lrwxrwxrwx 1 root root 16 Mei 11 15:45 python -> /usr/bin/python3
    lrwxrwxrwx 1 root root 9 Mac 13 2020 python2 -> python2.7
    -rwxr-xr-x 1 root root 3674216 Mac 8 21:02 python2.7
    lrwxrwxrwx 1 root root 33 Mac 8 21:02 python2.7-config -> x86_64-linux-gnu-python2.7-config
    lrwxrwxrwx 1 root root 16 Mac 13 2020 python2-config -> python2.7-config
    lrwxrwxrwx 1 root root 9 Mei 10 01:55 python3 -> python3.8
    -rwxr-xr-x 1 root root 5486384 Jan 27 23:41 python3.8

    Running the same on Live usb also yields the same result. Anything that I'm missing?

  2. #2
    Join Date
    Dec 2014
    Beans
    2,590

    Re: unable to run phyton

    Sadly the command line is strictly 'do what I say' (or rather 'type'), not 'do what I mean'. Typos like 'phyton' instead of 'python' (the 'h' comes after the 't', not after the 'p') will not be corrected automatically. Normally the 'command-not-found' handler of the shell should come up and print an educated guess about what you could have meant, but in this case it doesn't.

    Holger

  3. #3
    Join Date
    May 2008
    Beans
    3,984
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: unable to run phyton

    You have transposed the h and y in python

    phyton should be python

  4. #4
    Join Date
    May 2021
    Beans
    4

    Re: unable to run phyton

    Thank you all for pointing this out. My ignorance amuses me.....

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: unable to run phyton

    Quote Originally Posted by mkamal-amohsin View Post
    Thank you all for pointing this out. My ignorance amuses me.....
    And us, but you aren't the the first person to do this. Learn to use "tab-completion" and most issues like this will not happen anymore.
    https://github.com/jlevy/the-art-of-command-line -- tab-completion is 1000x harder to explain in words than to show/demonstrate. Type 2 characters for a command, then hit {tab}{tab}.

    If there's only 1 command in the PATH that begins with those 2 characters, it will be filled in. If there are more, a list of possible commands will be shown.

    In short, if you are typing more than 2 characters at a time+{tab}, then you are doing it the hard way.

    Most CLI tools have a bash-completion file so options to the command can also be completed ... or at least input files. Look for videos to show this stuff and make it a habit to use.

  6. #6
    Join Date
    May 2010
    Beans
    3,247

    Re: unable to run phyton

    Could make a symlink

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: unable to run phyton

    Quote Originally Posted by ActionParsnip View Post
    Could make a symlink
    or an alias
    Code:
    alias phyton='python'
    but that would only work from bash in a shell, not inside scripts.

  8. #8
    Join Date
    May 2021
    Beans
    4

    Re: unable to run phyton

    Quote Originally Posted by TheFu View Post
    And us, but you aren't the the first person to do this. Learn to use "tab-completion" and most issues like this will not happen anymore.
    https://github.com/jlevy/the-art-of-command-line -- tab-completion is 1000x harder to explain in words than to show/demonstrate. Type 2 characters for a command, then hit {tab}{tab}.

    If there's only 1 command in the PATH that begins with those 2 characters, it will be filled in. If there are more, a list of possible commands will be shown.

    In short, if you are typing more than 2 characters at a time+{tab}, then you are doing it the hard way.

    Most CLI tools have a bash-completion file so options to the command can also be completed ... or at least input files. Look for videos to show this stuff and make it a habit to use.
    Thanks for tip. Will remember that from now on

  9. #9
    Join Date
    Mar 2007
    Location
    Promiseland
    Beans
    1,549
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: unable to run phyton

    ...typing more than 2 characters at a time+{tab}, then you are doing it the hard way.
    My system insists on doing it the hard way
    Code:
    ~$ py<tab>
    py3clean      py3versions   pydoc3.8      pygettext3.8  pyjwt3        python3.8
    py3compile    pydoc3        pygettext3    pygmentize    python3
    Code:
    ~$ pyt<tab>
    results in
    Code:
     
    $ python3
    Am I doing something wrong?
    Last edited by him610; May 11th, 2021 at 10:44 PM. Reason: added text
    Cheers,


    The Linux Command Line at http://linuxcommand.org/

  10. #10
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: unable to run phyton

    Another tip regarding the terminal for those like myself who make typing errors. The terminal keeps a history of the commands we type. Pressing the up arrow key will scroll through them. The down arrow key will scroll the other way. Yes, we will see the wrongly typed commands but also those commands that we type correctly. It can reduce the opportunity for mistyping of commands.

    Regards
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •