Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError #25

Closed
mjrinker opened this issue Feb 28, 2018 · 5 comments
Closed

FileNotFoundError #25

mjrinker opened this issue Feb 28, 2018 · 5 comments

Comments

@mjrinker
Copy link

I'm getting a file not found error as shown below:

Traceback (most recent call last): File "D:/Users/[user]/Documents/NLP/arabic_tagger/build_model.py", line 6, in <module> nlp = StanfordCoreNLP(corenlp_path, lang='ar', memory='4g')
File "C:\Users\[user]\AppData\Roaming\Python\Python36\site-packages\stanfordcorenlp\corenlp.py", line 46, in __init__
if not subprocess.call(['java', '-version'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) == 0:
File "C:\Users\[user]\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\[user]\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Users\[user]\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

I have used this wrapper before and am using it in the same way as always:

corenlp_path = 'D:/Users/[user]/Desktop/StanfordCoreNLP/Full_CoreNLP_3.8.0'
nlp = StanfordCoreNLP(corenlp_path, lang='ar', memory='4g')

Just to be sure, I downloaded version 3.8.0 as well as the Arabic models and made sure they are in the path specified. I'm wondering if the FileNotFoundError is not referring to the CoreNLP path but something else... subprocess.py is in the correct directory. So yeah... not sure what's wrong/what to do.

Thanks!

@mjrinker
Copy link
Author

I posted this and realized that I don't have Java installed. I'll install and then check back here.

@mjrinker
Copy link
Author

Yeah, that was it. I also had to add Java to the path. Haha I feel dumb for posting this and then solving it a second later. But hopefully it helps someone in the future!

@99sun99
Copy link

99sun99 commented Apr 19, 2019

Thanks! it really helps!

@sahityasridhar08
Copy link

How do you add Java to the path ?

@mjrinker
Copy link
Author

@sahityasridhar08
Add Java to path:
https://www.baeldung.com/java-home-on-windows-7-8-10-mac-os-x-linux

If that link doesn't work for you, search Google for "Add Java to path" and make sure to choose a guide that includes steps specific to your OS (Windows, macOS, Linux, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants