添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am trying to run jupyter notebook through Anaconda in mac but it is showing :

-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 :

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

and when I run jupyter notebook in terminal it shows

/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.

Few days ago, I installed mongodb on my mac and when I run echo $PATH it shows /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.

Being a new mac user, I am not able to understand what is happening, so I gave the important details.

you were double clicking jupyter_mac.command? if so, imho knowing the content of that script might help, you should copy paste that in here – deadvoid Sep 30, 2018 at 12:21 that error message you posted is the result of that .command script. so in order to understand what that script did to generate the error message, you need to provide the script's content – deadvoid Sep 30, 2018 at 12:46 sorry, that seems quite straightforward to me, i don't understand why your installation path has a problem. first thing you can try is to verify your anaconda installation as described here docs.anaconda.com/anaconda/install/verify-install – deadvoid Sep 30, 2018 at 13:31

Your PATH tells the shell where to find programs. 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=....

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:

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

Once you have set your PATH correctly, start a new Terminal and run:

echo $PATH

in it to see if looks good.

I am unaware of information related to System files and all those stuff. Is there any source that I can learn about such minute details ? – ajaysinghnegi Sep 30, 2018 at 17:19 This is a pretty reasonable introduction to bash which is what you are asking about linuxconfig.org/bash-scripting-tutorial-for-beginners – Mark Setchell Sep 30, 2018 at 17:26

If you did a fresh install of Anaconda on macOS Catalina, you can fix it with the following command:

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. Then just add that to your path ;)

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.