简体   繁体   English

python:无法打开文件“帮助”:[Errno 2]没有此类文件或目录

[英]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.

相关问题 python:无法打开文件'python2':[Errno 2]没有这样的文件或目录 - python: can't open file 'python2': [Errno 2] No such file or directory python:无法打开文件“C:\\Program”:[Errno 2] 没有这样的文件或目录 - python: can't open file 'C:\Program': [Errno 2] No such file or directory 无法打开文件'python':[Errno 2]没有这样的文件或目录 - can't open file 'python': [Errno 2] No such file or directory 无法打开文件:[Errno 2] 没有那个文件或目录 - can't open file : [Errno 2] No such file or directory 无法打开文件 [Errno 2] 没有这样的文件或目录 - Can't Open File [Errno 2 ] No such file or directory 无法打开文件:[Errno 2] 没有那个文件或目录 - can't open file : [Errno 2] No such file or directory 无法打开文件'file.py':[Errno 2] 没有这样的文件或目录 - Can't open file 'file.py': [Errno 2] No such file or directory PyCharm 没有找到 Anaconda Python,给出“无法打开文件 'python.py':[Errno 2] 没有这样的文件或目录?” - PyCharm not finding Anaconda Python, giving “can't open file 'python.py': [Errno 2] No such file or directory?” 在Python中使用3to2,得到“ python:无法打开文件'3to2':[Errno 2]没有这样的文件或目录” - Using 3to2 in Python, get “python: can't open file '3to2': [Errno 2] No such file or directory” PyCharm 没有找到 Anaconda Python,给出“无法打开文件 'python':[Errno 2] 没有这样的文件或目录?” - PyCharm not finding Anaconda Python, giving "can't open file 'python': [Errno 2] No such file or directory?"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM