【发布时间】:2018-07-30 09:59:03
【问题描述】:
收到此错误 我的输入文件是
def get_data_from_file(file_path=os.path.('C:/Users/anees/chatbot_data.txt')):
with open(file_path) as infile:
cleaned_lines = [line.strip() for line in infile if not line.startswith(('$$$', '###', '==='))]
return cleaned_lines
错误
C:\Users\anees\Anaconda3\envs\chatbot\python.exe C:/Users/anees/PycharmProjects/Web_analytics/Assignment1/knowlege_extraction.py
Traceback (most recent call last):
File "C:/Users/anees/PycharmProjects/Web_analytics/Assignment1/knowlege_extraction.py", line 245, in <module>
main()
File "C:/Users/anees/PycharmProjects/Web_analytics/Assignment1/knowlege_extraction.py", line 218, in main
triples = cl.extract_triples(sents)
File "C:\Users\anees\Anaconda3\envs\chatbot\lib\site-packages\pyclausie-0.1-py2.7.egg\pyclausie\SubprocessBackend.py", line 62, in extract_triples
stderr=subprocess.PIPE)
File "C:\Users\anees\Anaconda3\envs\chatbot\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Users\anees\Anaconda3\envs\chatbot\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Process finished with exit code 1
【问题讨论】:
-
找不到错误请帮忙
-
os.path.中的第二个点是故意的吗? -
不,这不是故意的......也没有必要使用 os.path
标签: python python-2.7 pycharm anaconda