2024-04-19 14:51:09 发布
网友
在python中加载文件时遇到问题。激活virualenv后,我正在运行pycharm。在
virualenv
pycharm
我试图加载softdata.txt,它在softmax classification.py的同一个文件夹中
softdata.txt
softmax classification.py
出现以下错误:No such file or directory: 'softdata.txt'
No such file or directory: 'softdata.txt'
我不明白为什么会这样。请帮帮我。在
你百分之百确定softdata是一个.txt文件吗?我看不到分机
我还注意到以下几点
它似乎没有读入多功能文件路径
Python文件名中不能有空格。这是因为Python文件(.py)实际上是可导入的模块,并且不能有名称中带有空格的模块。在
.py
错误实际上在屏幕的底部,显示:
Cannot start process, the working directory '/root/PycharmProjects/tensorflow study/softmax' does not exist
注意,它在softmax停止,即使文件名为softmax分类.py。在
简单的解决方案是重命名文件并删除空间;因此文件softmax classification.py是softmaxclassification.py。在
softmaxclassification.py
您可能还想将current directory.py重命名为currentdirectory.py。在
current directory.py
currentdirectory.py
你百分之百确定softdata是一个.txt文件吗?我看不到分机
我还注意到以下几点
它似乎没有读入多功能文件路径
Python文件名中不能有空格。这是因为Python文件(
.py
)实际上是可导入的模块,并且不能有名称中带有空格的模块。在错误实际上在屏幕的底部,显示:
Cannot start process, the working directory '/root/PycharmProjects/tensorflow study/softmax' does not exist
注意,它在softmax停止,即使文件名为softmax分类.py。在
简单的解决方案是重命名文件并删除空间;因此文件
softmax classification.py
是softmaxclassification.py
。在您可能还想将
current directory.py
重命名为currentdirectory.py
。在相关问题 更多 >
编程相关推荐