繁体   English   中英

第一次安装python,用git bash测试

[英]First time to install python, and test in git bash

操作系统:Windows 10

这是第一次安装python。

我想在 git bash 上运行 python。

我以前没有使用过 python 或 git bash。

  1. 我安装了便携式 git。
    C:\Users\用户名\Desktop\PortableGit

在此处输入图像描述

  1. 我在 Portable git 文件夹中创建了一个名为 ib 的小文件,其内容为

在此处输入代码

  1. 我安装了python
    C:\Users\用户名\AppData\Local\Programs\Python\Python310

在此处输入图像描述

  1. 在便携式 git 文件夹中运行 git-bash.exe,
    并检查python的版本,然后运行ib。

    python --version ./ib

在此处输入图像描述

它说没有这样的文件或目录。 代码 ./ib 不起作用。 你可以教我吗?

如果您需要更多信息,可以问我!(任务/截图)

您需要将包含 python 可执行文件的目录添加到PATH变量中。 一种方法是在主目录中编辑.bashrc并添加类似于

export PATH=$PATH:/path/to/python

/path/to/python替换为python3所在的目录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM