首页 > 解决方案 > python:无法打开文件“帮助”:[Errno 2]没有这样的文件或目录

问题描述

我正在尝试在我的 cpanel 项目上安装 python 包。但面临奇怪的问题。以下是各种命令的 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.

当我尝试命令帮助时,得到以下响应:

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

我正在尝试从名为“myproject”的项目目录中安装软件包。在安装软件包时,我得到了相同的响应:

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

我从错误日志中了解到的是 python 命令不起作用/无法识别。我已经搜索了各种解决方案,但找不到有关此问题的任何解决方案。这里的任何人都可以帮我强调我可能犯的错误吗?以及如何解决?

标签: pythonpython-2.7python-requests

解决方案


当您打电话时,python help您正试图打开文件help。你想要的是打电话python --help。如果你想安装请求,你可以这样做pip install requests


推荐阅读