Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/399.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/353.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 Java管道:未找到dev/stdin文件异常_Java_Python_Twitter_Stdin - Fatal编程技术网

Python Java管道:未找到dev/stdin文件异常

Python Java管道:未找到dev/stdin文件异常,java,python,twitter,stdin,Java,Python,Twitter,Stdin,尝试使用python包装器,但其引发以下错误: java.io.FileNotFoundException: \dev\stdin (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileInputStream.&

尝试使用python包装器,但其引发以下错误:

java.io.FileNotFoundException: \dev\stdin (The system cannot find the path specified)

at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at cmu.arktweetnlp.util.BasicFileIO.openFileToReadUTF8(BasicFileIO.java:50)
    at cmu.arktweetnlp.RunTagger.runTagger(RunTagger.java:93)
    at cmu.arktweetnlp.RunTagger.main(RunTagger.java:364)
Sep 17, 2014 10:22:45 AM cmu.arktweetnlp.util.BasicFileIO openFileToReadUTF8
SEVERE: Could not open file:/dev/stdin
java.io.FileNotFoundException:\dev\stdin(系统找不到指定的路径)
在java.io.FileInputStream.open(本机方法)
位于java.io.FileInputStream。(未知源)
位于java.io.FileInputStream。(未知源)
在cmu.arktweetnlp.util.basicfileo.openfiletoreaduttf8(BasicFileIO.java:50)
位于cmu.arktweetnlp.RunTagger.RunTagger(RunTagger.java:93)
位于cmu.arktweetnlp.RunTagger.main(RunTagger.java:364)
2014年9月17日上午10:22:45 cmu.arktweetnlp.util.BasicFileIO OpenFileToRead8
严重:无法打开文件:/dev/stdin
重新安装JDK而不是仅安装JRE。什么都没修好。不知道该怎么办,因为我甚至找不到java目录中的dev文件夹。。。哈尔普=(

如果不带python的cmd行调用为'sh'、'runTagger.sh'、'--output format'、'conll'、[File with tweets to tag],则执行java程序,但我需要它通过stdin=)标记来自python的传入tweets流)


EDIT在CygWin中找到了dev/stdin,并尝试添加路径“c:…\CygWin”和“c:…\CygWin\dev”,但再次没有发生任何事情

我也永远无法解决这个问题。我找到了解决办法

您可以使用以下代码:

import subprocess

p = subprocess.check_output('java -XX:ParallelGCThreads=2 -Xmx500m -jar ark-tweet-nlp-0.3.2.jar examples/example_tweets.txt')

这将为您提供通过标记器运行示例tweets文件的输出。

我也有同样的问题。你找到解决办法了吗?谢谢,先生,你是今天的英雄。