2024-04-19 18:26:09 发布
网友
我一直在为Python研究熊猫。我正在做我的实际工作,在朱派特笔记本。我尝试在Jupyter notebook中运行几个Linux命令,结果如下:
如您所见,我可以运行ls命令,但不能运行cat命令。我尝试执行cat命令,就像!cat一样,但是它无法识别,如下所示:
ls
cat
!cat
从截图可以看出,IPython是错误消息的一部分。Jupyter notebook is using IPython当你在Windows中运行这些命令时。在
IPython documentation about magic commands:
For posix systems, the default aliases are ‘cat’, ‘cp’, ‘mv’, ‘rm’, ‘rmdir’, and ‘mkdir’, and other platform-specific aliases are added.For windows-based systems, the default aliases are ‘copy’, ‘ddir’, ‘echo’, ‘ls’, ‘ldir’, ‘mkdir’, ‘ren’, and ‘rmdir’.
For posix systems, the default aliases are ‘cat’, ‘cp’, ‘mv’, ‘rm’, ‘rmdir’, and ‘mkdir’, and other platform-specific aliases are added.
For windows-based systems, the default aliases are ‘copy’, ‘ddir’, ‘echo’, ‘ls’, ‘ldir’, ‘mkdir’, ‘ren’, and ‘rmdir’.
这就是为什么Linux ls可以工作,但是cat命令对Windows上的IPython不起作用。在
注意:IPython不是一个命令行工具。对于Windows上的Linux命令行工具,请尝试Cygwin。在
从截图可以看出,IPython是错误消息的一部分。Jupyter notebook is using IPython当你在Windows中运行这些命令时。在
IPython documentation about magic commands:
这就是为什么Linux
ls
可以工作,但是cat
命令对Windows上的IPython不起作用。在注意:IPython不是一个命令行工具。对于Windows上的Linux命令行工具,请尝试Cygwin。在
相关问题 更多 >
编程相关推荐