Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python source ~/.profile命令抛出错误_Python_Linux_Bash_Unix_Profile - Fatal编程技术网

Python source ~/.profile命令抛出错误

Python source ~/.profile命令抛出错误,python,linux,bash,unix,profile,Python,Linux,Bash,Unix,Profile,我正在尝试重新加载外壳,我在谷歌上搜索了很多,在下面的命令中找到了修复它的命令。但是当我运行该命令时,我得到以下错误python:无法打开文件'/test.py':[Errno 2]没有这样的文件或目录 rasminayak@DEBIAN-TEST:~$ source ~/.profile python: can't open file './test.py': [Errno 2] No such file or directory rasminayak@DEBIAN-TEST:~$ 我也试过

我正在尝试重新加载外壳,我在谷歌上搜索了很多,在下面的命令中找到了修复它的命令。但是当我运行该命令时,我得到以下错误
python:无法打开文件'/test.py':[Errno 2]没有这样的文件或目录

rasminayak@DEBIAN-TEST:~$ source ~/.profile
python: can't open file './test.py': [Errno 2] No such file or directory
rasminayak@DEBIAN-TEST:~$
我也试过了

rasminayak@DEBIAN-TEST:~$ source .bashrc
python: can't open file './test.py': [Errno 2] No such file or directory
rasminayak@DEBIAN-TEST:~$ 

您需要从.bashrc中删除test.py文件

您可以共享~/.profile的内容吗?请检查您的.profile第2行中有什么内容?如果可能的话,也可以在你的帖子上分享
PS4=':${BASH_SOURCE}:$LINENO+'。~/。profile
将记录每个命令运行时所使用的文件和行号,这样您就可以准确地看到错误的来源。也就是说,堆栈溢出仅适用于有关编写软件的问题。配置交互式shell并不是专门与软件开发相关的任务。您的
.bashrc
正在工作目录中查找文件
test.py
。那里没有。你应该知道为什么这一行被添加到你的bashrc中(如果它不再相关的话&删除它)是的,这就是问题所在,我认为其中一个allias有
test.py
。我删除了它,它解决了这个问题。@subm,在中,请注意“回答好的问题”部分,以及其中关于“与帮助中心定义的编程无关”的问题的条目。