【macOS】【zsh报错】zsh: command not found: python

 【macOS】【zsh Error】zsh: command not found: python

本地已经安装了Python,且能在Pycharm中编译Python程序并运行。

但是,在macOS终端,运行Python,报错。

首先要确认你在macOS系统下,是否安装了Python。

如果安装了,还要确认Python名称。

例如,我在终端输入python,报错:zsh: command not found: python。

而实际上,我的Python,安装在路径:/usr/local/bin

且文件名为:Python3.

所以,需要在终端输入:python3,才能正确运行。

----------------------------------------

下面是配置环境变量的步骤:

----------------------------------------

There are a few possible reasons why you might be getting this error:

1. Python is not in your PATH:

  • Check the installation location: 
    Make sure you installed Python to a directory that is in your system's PATH.
    Common locations include /usr/local/bin or /opt/anaconda3/bin.

  • Add the directory to your PATH: 
    If the directory is not in your PATH,
     you can add it by editing your .zshrc or .bash_profile file. 
    For example,
     if Python is installed in /usr/local/bin,
     you would add the following line to your .zshrc file:

    Bash

    export PATH="/usr/local/bin:$PATH"
    

    【Note】:
    Goodmao has successfully completed the Python installation and configured the PATH environment variable.

    vi ~/.bash_profile
    /usr/local/bin 
  • Restart your terminal: 
    After making changes to your .zshrc or .bash_profile file,
     you need to restart your terminal for the changes to take effect.

2. You're using the wrong shell:

  • Make sure you're using the correct shell. 
    If you're using a different shell, such as bash,
     you might need to use a different command to start Python. 
    For example, in bash, you would use python3 instead of python.

3. Python is not installed correctly:

  • If you're still having trouble, it's possible that Python is not installed correctly. 
    Try reinstalling Python or checking the installation logs for any errors.

Here's a summary of the steps you can take to resolve the issue:

  1. Check the installation location: 
    Make sure Python is installed in a directory that is in your PATH.
  2. Add the directory to your PATH: 
    If necessary, add the directory to your .zshrc or .bash_profile file.
  3. Restart your terminal: 
    Restart your terminal for the changes to take effect.
  4. Try using a different shell: 
    If you're using a different shell, try using the appropriate command to start Python.
  5. Reinstall Python: 
    If all else fails, try reinstalling Python.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1539664.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

去噪扩散隐式模型

dataset_name "datasets/oxford-102-flowers/" dataset_repetitions 2 # 数据集重复 num_epochs 25 image_size 64 # 模型训练和生成图像的大小 # KID 内核初始距离 kid_image_size 75 # 从噪声中逐步“去噪”或“扩散”到最终图像所需的步骤数。 kid_diffusi…

NEMESIS: NORMALIZING THE SOFT-PROMPT VECTORS OF VISION-LANGUAGE MODELS

文章汇总 发现的现象 动机的描述 Norm增加会导致性能下降,Norm降低会导致性能上升。于是作者提出: 我们需要规范化VLMs中的软提示吗? 实验验证 在左图中的紫色块中可以看到,随着模型性能的上升,Norm value会不断下降。 解决…

C语言 | Leetcode C语言题解之第419题棋盘上的战舰

题目&#xff1a; 题解&#xff1a; int countBattleships(char** board, int boardSize, int* boardColSize){int row boardSize;int col boardColSize[0];int ans 0;for (int i 0; i < row; i) {for (int j 0; j < col; j) {if (board[i][j] X) {if (i > 0 &…

ant vue3 datePicker默认显示英文

改前&#xff1a; 改后&#xff1a; 处理方法&#xff1a; 在App.vue页加上以下导入即可 import dayjs from dayjs; import dayjs/locale/zh-cn dayjs.locale(zh-cn); 如图&#xff1a;

电力电塔电线缺陷检测数据集 voc yolo

电力 电塔电线缺陷检测数据集 10000张 带标注 voc yolo 电力电塔电线缺陷检测数据集 数据集描述 该数据集旨在用于电力电塔和电线的缺陷检测任务&#xff0c;涵盖多种常见的缺陷类型。数据集包含了大量的图像及其对应的标注信息&#xff0c;可用于训练计算机视觉模型&#x…

如何搭建虚拟机Ubuntu?

1.创建新虚拟机 2.进入新建虚拟机向导&#xff0c;选择稍后安装 3. 选择Linux中的Ubuntu 4.为虚拟机命名设置路径 5. 设置磁盘容量大小 6.选择自定义硬件 7.设置设备状态 8.完成Ubuntu虚拟机创建

【Verilog学习日常】—牛客网刷题—Verilog快速入门—VL24

边沿检测 有一个缓慢变化的1bit信号a&#xff0c;编写一个程序检测a信号的上升沿给出指示信号rise&#xff0c;当a信号出现下降沿时给出指示信号down。 注&#xff1a;rise,down应为单脉冲信号&#xff0c;在相应边沿出现时的下一个时钟为高&#xff0c;之后恢复到0&#xff0…

Pandas_数据结构详解

1.创建DataFrame对象 概述 DataFrame是一个表格型的结构化数据结构&#xff0c;它含有一组或多组有序的列&#xff08;Series&#xff09;&#xff0c;每列可以是不同的值类型&#xff08;数值、字符串、布尔值等&#xff09;。 DataFrame是Pandas中的最基本的数据结构对象&am…

【kafka-04】kafka线上问题以及高效原理

Kafka系列整体栏目 内容链接地址【一】afka安装和基本核心概念https://zhenghuisheng.blog.csdn.net/article/details/142213307【二】kafka集群搭建https://zhenghuisheng.blog.csdn.net/article/details/142253288【三】springboot整合kafka以及核心参数详解https://zhenghui…

中间件安全(二)

本文仅作为学习参考使用&#xff0c;本文作者对任何使用本文进行渗透攻击破坏不负任何责任。 前言: 前文链接&#xff1a;中间件安全&#xff08;一&#xff09; 本文主要讲解Couchdb数据库未授权越权漏洞&#xff08;CVE-2017-12635&#xff09;。 靶场链接&#xff1a;Vu…

【内网渗透】最保姆级的春秋云镜Privilege打靶笔记

目录 flag1 flag2 flag3 flag4 flag1 fscan扫外网 访问./www.zip拿到源码 tools/content-log.php存在任意文件读取 根据提示读到Jenkins初始管理员密码 ./tools/content-log.php?logfile../../../../../../../../../ProgramData/Jenkins/.jenkins/secrets/initialAdminP…

Docker UI强大之处?

DockerUI是一款由国内开发者打造的优秀Docker可视化管理工具。它拥有简洁直观的用户界面&#xff0c;使得Docker主机管理、集群管理和任务编排变得轻松简单。DockerUI不仅能展示资源利用率、系统信息和更新日志&#xff0c;还提供了镜像管理功能&#xff0c;帮助用户高效清理中…

Spring Boot 整合 MyBatis 的详细步骤(两种方式)

1. Spring Boot 配置 MyBatis 的详细步骤 1、首先&#xff0c;我们创建相关测试的数据库&#xff0c;数据表。如下&#xff1a; CREATE DATABASE springboot_mybatis USE springboot_mybatisCREATE TABLE monster ( id int not null auto_increment, age int not null, birthda…

Vue 实现高级穿梭框 Transfer 封装

文章目录 01 基础信息1.1. 技术栈1.2. 组件设计a. 竖版设计稿b. 横版设计稿 02 技术方案&#xff08;1&#xff09;初定义数据&#xff08;2&#xff09;注意事项&#xff08;3&#xff09;逻辑草图 03 代码示例3.1. 组件使用3.2. 组件源码./TransferPlus/index.vue./TransferP…

动物识别系统Python+卷积神经网络算法+TensorFlow+人工智能+图像识别+计算机毕业设计项目

一、介绍 动物识别系统。本项目以Python作为主要编程语言&#xff0c;并基于TensorFlow搭建ResNet50卷积神经网络算法模型&#xff0c;通过收集4种常见的动物图像数据集&#xff08;猫、狗、鸡、马&#xff09;然后进行模型训练&#xff0c;得到一个识别精度较高的模型文件&am…

开源项目 GAN 漫画风格化 UGATIT

开源项目&#xff1a;DataBall / UGATIT GitCode * 数据集 * [该项目制作的训练集的数据集下载地址(百度网盘 Password: gxl1 )](https://pan.baidu.com/s/1683TRcv3r3o7jSitq3VyYA) * 预训练模型 * [预训练模型下载地址(百度网盘 Password: khbg )](https://pan.ba…

Request 跨线程访问问题

优质博文&#xff1a;IT-BLOG-CN 此篇文章是基于 Tomcat Request Cookie 丢失问题 文章的一个延续 一、Request 跨线程访问问题 问题代码摘要 为了方便选择发起get请求&#xff0c;然后只需要传递一个参数就行&#xff0c;核心步骤是要把request传递到异步线程里面去&#xf…

GAMES104:15 游戏引擎的玩法系统基础-学习笔记

文章目录 0&#xff0c;游戏性课程框架一&#xff0c;事件机制1.1 事件的定义1.2 callback的注册1.3 事件的分发系统 二&#xff0c;游戏逻辑与脚本系统2.1 特点和常见脚本语言2.2 脚本语言的GO管理2.3 脚本语言的架构2.4 可视化脚本 三&#xff0c;Gameplay 开发中的3C &#…

一体化平台数据中心安全建设方案(Word完整原件)

第 一 章 信息安全保障系统 1.1 系统概述 1.2 安全标准 1.3 系统架构 1.4 系统详细设计 1.4.1 计算环境安全 1.4.2 区域边界安全 1.4.3 通信网络安全 1.4.4 管理中心安全 1.5 安全设备及系统 1.5.1 VPN加密系统 1.5.2 入侵防御系统 1.5.3 防火墙系统 1.5.4 安全审计系统 1.5.5 …

2018年国赛高教杯数学建模D题汽车总装线的配置问题解题全过程文档及程序

2018年国赛高教杯数学建模 D题 汽车总装线的配置问题 一&#xff0e;问题背景   某汽车公司生产多种型号的汽车&#xff0c;每种型号由品牌、配置、动力、驱动、颜色5种属性确定。品牌分为A1和A2两种&#xff0c;配置分为B1、B2、B3、B4、B5和B6六种&#xff0c;动力分为汽油…