有问题可以运行PIP在MacOS终端安装的Python命令
我不是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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这样的事情:
Try something like this:
您可以创建或编辑
/users/yimingliu/.zshrc
file(如果您的macOS比Macos Catalina 10.15都老,则文件为/users/yimingliu/.bash_profile
),并添加一条线以将Python bin文件夹添加到您的路径: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: