我想我在 jupyter notebook/python3 中进行故障排除时搞砸了我的文件目录



我不确定从哪里开始这个问题,但我对python相对较新,并且主要使用Jupyter notebook和Python 3.7。

在解决了许多问题(特别是设置虚拟环境并将软件包安装到该环境中(之后,我似乎搞砸了我的文件目录。

特别令人不安的是我无法从我的base(root(启动jupyter笔记本,而是在终端中显示以下文本:

Last login: Sun Dec 22 21:02:15 on ttys000
/Users/*********/anaconda3/bin/jupyter_mac.command ; exit;
-bash: dirname: command not found
-bash: dirname: command not found
-bash: /etc/profile.d/conda.sh: No such file or directory
-bash: conda: command not found
********-MacBook-Pro:~ *********$ /Users/********/anaconda3/bin/jupyter_mac.command ; exit;
/Users/********/anaconda3/bin/jupyter_mac.command: line 1: dirname: command not found
/Users/********/anaconda3/bin/jupyter_mac.command: line 3: /jupyter-notebook: No such file or directory
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]

上面,我的名字已经编辑了。

另一方面,如果我打开一个空白的终端窗口,系统会提示我:

Last login: Sun Dec 22 20:54:30 on ttys000
-bash: dirname: command not found
-bash: dirname: command not found
-bash: /etc/profile.d/conda.sh: No such file or directory
-bash: conda: command not found
********-MacBook-Pro:~ ********$ 

任何帮助将不胜感激!今晚我将尝试进行系统更新,看看在此期间是否可以解决任何问题。

您可能已经更改了.bash_profile并从 PATH(dirname和其他命令所在的位置(中删除了/usr/bin,也许还有其他内容。

检查$PATH的内容:

$ echo $PATH

并恢复似乎缺少的任何内容。

我不确定,但我认为 Mac 上的 conda 环境是错误的。 你能试试下一个吗?

  1. 打开终端
  2. 类型 source ~/anaconda3/etc/profile.d/conda.sh
  3. 类型 康达初始化
  4. 重新启动终端
  5. 再次尝试 Jupyter 笔记本

最新更新