简体   繁体   English

/bin/sh: osascript: 命令未找到

[英]/bin/sh: osascript: command not found

I am trying to run jupyter notebook through Anaconda in mac but it is showing :我正在尝试通过 Mac 中的Anaconda运行 jupyter notebook,但它显示:

-bash: touch: command not found
MacBook-Air:~ ajay$ /anaconda3/bin/jupyter_mac.command ; exit;
/anaconda3/bin/jupyter_mac.command: line 1: dirname: command not found
/anaconda3/bin/jupyter_mac.command: line 3: /jupyter-notebook: No such file or directory
logout
Saving session...-bash: date: command not found
-bash: touch: command not found

...copying shared history...-bash: cp: command not found

...saving history...-bash: cat: command not found
-bash: cat: command not found
truncating history files...
...completed.
-bash: find: command not found
-bash: shlock: command not found

[Process completed]

The content of jupyter_mac.command are : jupyter_mac.command的内容是:

DIR=$(dirname $0)
$DIR/jupyter-notebook

and when I run jupyter notebook in terminal it shows当我在终端中运行jupyter notebook ,它显示

/bin/sh: osascript: command not found

I also checked to see jupyterlab on Anaconda and it was working fine but jupyter notebook was not opening.我还检查了Anaconda jupyterlab ,它工作正常,但jupyter notebook没有打开。

Few days ago, I installed mongodb on my mac and when I run echo $PATH it shows /anaconda3/bin:/usr/local/mongodb/bin:??几天前,我在 Mac 上安装了mongodb ,当我运行echo $PATH它显示/anaconda3/bin:/usr/local/mongodb/bin:??

I, even, reinstalled anaconda and before reinstalling deleted its folder from the drive but it still giving the same problem.我什至重新安装了anaconda ,在重新安装之前从驱动器中删除了它的文件夹,但它仍然出现同样的问题。

Being a new mac user, I am not able to understand what is happening, so I gave the important details.作为一个新的 mac 用户,我无法理解发生了什么,所以我提供了重要的细节。

Your PATH tells the shell where to find programs.您的 PATH 告诉 shell 在哪里可以找到程序。 Yours is messed up, so it cannot find anything.你的搞砸了,所以它找不到任何东西。 It is probably set in $HOME/.profile so you need to open that file in your editor and look for export PATH=... .它可能设置在$HOME/.profile因此您需要在编辑器中打开该文件并查找export PATH=...

You probably want it set something like:您可能希望它设置如下:

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/anaconda3/bin:/usr/local/mongodb/bin

In future, where you add anything to your PATH, you need to carry forward whatever it was previously set to and append like this:将来,在向 PATH 添加任何内容的地方,您需要继承之前设置的内容并像这样附加:

export PATH="$PATH":/some/new/directory

Once you have set your PATH correctly, start a new Terminal and run:正确设置 PATH 后,启动一个新终端并运行:

echo $PATH

in it to see if looks good.在里面看看是否好看。

If you did a fresh install of Anaconda on macOS Catalina, you can fix it with the following command:如果您在 macOS Catalina 上全新安装了 Anaconda,则可以使用以下命令修复它:

export PATH=/opt/anaconda3/bin:$PATH 

That worked for me, but in case this is not the correct path for you, you can run Jupiter notebook from the GUI of Anaconda navigator, and check on the terminal window that is opened automatically where is the anaconda3 folder.这对我有用,但如果这对您来说不是正确的路径,您可以从 Anaconda 导航器的 GUI 运行 Jupiter notebook,并检查自动打开的终端窗口,anaconda3 文件夹在哪里。 Then just add that to your path ;)然后将其添加到您的路径中;)

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

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