skip to Main Content

I am trying to install python packages on my cpanel project. But facing weird issues. Below is cpanel outputs on various commands:

[root@host myproject]# python
Python 2.7.5 (default, Apr 11 2018, 07:36:10)[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2Type "help", "copyright", "credits" or "license" for more information.

When I try for command help, get following reponse:

[root@host myproject]# python help
python: can't open file 'help': [Errno 2] No such file or directory

I am trying to install packages from my project directory named ‘myproject’. While installing packages I am getting same response:

[root@host myproject]# python install requests
python: can't open file 'install': [Errno 2] No such file or directory[root@host myproject]#

What I am understanding from error log is python commands are not working/recognized. I have searched for various solutions but could not find any about this issue. Can anybody here help me highlighting what possible mistake I am making? and how this can be solved?

2

Answers


  1. When you call python help you are trying to open the file help. What you want is calling python --help. If you want to install requests you can do pip install requests.

    Login or Signup to reply.
  2. In short:

    To display command help, you need to run

    python --help
    

    (not python help, which instructs python to run a file named help)

    To install a package, you need to run pip (python package manager):

    pip install your-package-name
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search