有问题可以运行PIP在MacOS终端安装的Python命令

发布于 2025-02-10 09:10:56 字数 432 浏览 1 评论 0原文

我不是Python用户,所以对Python了解一无所知。但是我必须在其官方指南之后安装stcgal使用pip3使用pip3使用pip3。

pip3 install stcgal

但是,如果我在终端中运行已安装的命令,则说ZSH:找不到命令

经过长时间的搜索,我发现它是在/users/myusername/library/python/3.8/bin/上安装的。尽管我可以使用该路径运行命令,但这很不方便。我想知道有什么方法可以在任何目录中运行代码,而必须明确定位它?

I'm not a Python user, so know little about Python. But I have to install stcgal using pip3 following its official guide.

pip3 install stcgal

However, if I run the installed command in terminal, it says zsh: command not found.

After a long searching, I find it was installed at /Users/myUserName/Library/Python/3.8/bin/. Though I can run the command with that path, it's very inconvenient. I wonder is there any way to run the code in any directory instead having to locate it explicitly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

早乙女 2025-02-17 09:10:56

尝试这样的事情:

python -m stcgal -h

Try something like this:

python -m stcgal -h
玩心态 2025-02-17 09:10:56

您可以创建或编辑/users/yimingliu/.zshrc file(如果您的macOS比Macos Catalina 10.15都老,则文件为/users/yimingliu/.bash_profile ),并添加一条线以将Python bin文件夹添加到您的路径:

export PATH=/Users/yimingliu/Library/Python/3.8/bin:$PATH

You can create or edit your /Users/yimingliu/.zshrc file (if your macOS is older than macOS Catalina 10.15, then the file is /Users/yimingliu/.bash_profile), and add a line to add the python bin folder to your path:

export PATH=/Users/yimingliu/Library/Python/3.8/bin:$PATH
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文