-bash: pip: 未找到命令 python: can‘t open file ‘pip‘: [Errno 2] No such file or directory

35 篇文章 0 订阅
11 篇文章 1 订阅

EPEL源

EPEL(Extra Packages for Enterprise Linux)是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS等提供高质量软件包的项目。装上了 EPEL,就像在 Fedora 上一样,可以通过 yum install 软件包名,即可安装很多以前需要编译安装的软件、常用的软件或一些比较流行的软件,比如现在流行的nginx、htop、ncdu、vnstat等等,都可以使用EPEL很方便的安装更新。

直接通过执行yum命令

执行命令: yum install epel-release 直接进行安装,如果此命令无法安装可以尝试以下方法

安装EPEL 阿里云源

1、备份(如有配置其他epel源)

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

2、下载新repo 到/etc/yum.repos.d/

epel(RHEL 7)

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

安装EPEL 163镜像源

1:备份你的原镜像文件,以免出错后可以恢复。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2:下载新的CentOS-Base.repo 到/etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

安装了epel源之后先清空历史缓存再构建新的缓存

yum clean all
yum makecache

使用 yum install python-pip 进行安装pip

 pip

Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output.
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
  --trusted-host <hostname>   Mark this host as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the
                              certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine whether a new version of pip is available for
                              download. Implied with --no-index.

pip install psycopg2-binary

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
出现"python3.8: can't open file 'pip': [Errno 2] No such file or directory"错误的原因是在您的系统中未找到pip命令。这可能是因为您没有正确安装Python的包管理器pip或者pip的路径没有被正确配置。 为了解决这个问题,您可以按照以下步骤进行操作: 1. 确保您已经正确安装了Python,并且将其路径添加到系统的环境变量中。 2. 检查pip是否已经正确安装。您可以在终端或命令提示符下运行"pip"命令来检查。如果出现类似于"pip"不是内部或外部命令的错误消息,那么您需要安装pip。 3. 如果您确定pip未安装,请按照以下步骤安装它: - 在终端或命令提示符下运行以下命令来安装pip:curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - 接着运行:python get-pip.py - 安装完成后,您可以再次运行"pip"命令来验证pip已经正确安装。 请注意,这些步骤是在假设您已经正确安装了Python的情况下进行的。如果您还没有安装Python,请先安装Python,然后再按照上述步骤安装pip。 希望这能帮助您解决问题!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [-bash: pip: 未找到命令 python: can‘t open filepip‘: [Errno 2] No such file or directory](https://blog.csdn.net/sunny_day_day/article/details/125151957)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [python 找不到文件异常 FileNotFoundError: [Errno 2] No such file or directory:](https://blog.csdn.net/weixin_44262000/article/details/124491060)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [使用Python和TensorFlow库来构建和训练一个简单的图像分类模型的完整代码(附详细操作步骤).txt](https://download.csdn.net/download/weixin_44609920/88234146)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值