[英]python: can't open file 'help': [Errno 2] No such file or directory
I am trying to install python packages on my cpanel project. 我正在尝试在我的cpanel项目上安装python软件包。 But facing weird issues.
但是面临奇怪的问题。 Below is cpanel outputs on various commands:
以下是各种命令的cpanel输出:
[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'. 我正在尝试从名为“ 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. 我从错误日志中了解到的是python命令无法正常工作/无法识别。 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?
以及如何解决?
When you call python help
you are trying to open the file help
. 当您调用
python help
您正在尝试打开文件help
。 What you want is calling python --help
. 您想要的是调用
python --help
。 If you want to install requests you can do pip install requests
. 如果要安装请求,可以执行
pip install requests
。
In short: 简而言之:
To display command help, you need to run 要显示命令帮助,您需要运行
python --help
(not python help
, which instructs python to run a file named help
) (不是
python help
,它指示python运行名为help
的文件)
To install a package, you need to run pip
(python package manager): 要安装软件包,您需要运行
pip
(python软件包管理器):
pip install your-package-name
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.