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
When you call
python help
you are trying to open the filehelp
. What you want is callingpython --help
. If you want to install requests you can dopip install requests
.In short:
To display command help, you need to run
(not
python help
, which instructs python to run a file namedhelp
)To install a package, you need to run
pip
(python package manager):