I'm currently trying to install pyrouge, and I'm getting the following errors
======================================================================
ERROR: test_options (pyrouge.tests.Rouge155_test.PyrougeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/Rouge155_test.py", line 218, in test_options
pyrouge_output = check_output_clean(pyrouge_command)
File "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/Rouge155_test.py", line 17, in <lambda>
check_output_clean = lambda c: check_output(c).decode("UTF-8").strip()
File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
======================================================================
ERROR: test_write_config (pyrouge.tests.Rouge155_test.PyrougeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/Rouge155_test.py", line 197, in test_write_config
check_output(command.split())
File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------------------------------------
I'm running Ubuntu, and I have installed XML::DOM using the synaptic package installer.
Additionally, I have ran the pyrouge_set_rouge_path.py command and have directed it to my ROUGE directory. I have used sudo for all my installations.
In Rouge155_test.py file, you should modify two lines:
modify
"pyrouge_evaluate_plain_text_files.py -m {} -s {} -sfp "
to
"pyrouge_evaluate_plain_text_files -m {} -s {} -sfp "
And,
modify
"pyrouge_write_config_file.py -m {m} -s {s} "
to
"pyrouge_write_config_file -m {m} -s {s} "
Related
I'm trying to use pytesseract library on linux but receiving the following error.
How to solve this error log
Traceback (most recent call last):
File "/home/rawnewton/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 254, in run_tesseract
proc = subprocess.Popen(cmd_args, **subprocess_args())
File "/usr/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'System_path_to_tesseract.exe'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/2E50C9C750C995CD/Projects/Public/MajorProject/image_text.py", line 58, in <module>
text = pytesseract.image_to_string(cropped)
File "/home/rawnewton/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 416, in image_to_string
return {
File "/home/rawnewton/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 419, in <lambda>
Output.STRING: lambda: run_and_get_output(*args),
File "/home/rawnewton/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 286, in run_and_get_output
run_tesseract(**kwargs)
File "/home/rawnewton/.local/lib/python3.10/site-packages/pytesseract/pytesseract.py", line 258, in run_tesseract
raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: System_path_to_tesseract.exe is not installed or it's not in your PATH. See README file for more information.
I have installed it using the following commands:
pip install tesseract
pip install tesseract-ocr
I am using Xubuntu version 20.04.
I am trying:
import subprocess
subprocess.call(["file.sh"])
But I keep getting:
Traceback (most recent call last):
File "project.py", line 85, in <module>
subprocess.call(["file.sh"])
File "/usr/local/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/local/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
However when I try and run the script from the shell bash file.sh it works. So I'm confused as to why it doesn't work?
I am not committed to using subprocess so if there are other options please let me know.
The call function of the subprocess package runs the command specified in arg as a list of strings (to simplify).
To call your file you have put in your script:
import subprocess
subprocess.call(["sh", "file.sh"])
I am getting this error when trying to build a project with
djangocms -p . mysite
I have gone through all the answers in StackOverflow but couldn't solve the problem.
Traceback (most recent call last):
File "C:\Users\PC4\Desktop\site14\env\Scripts\djangocms-script.py", line 9, in <module>
load_entry_point('djangocms-installer==0.8.1', 'console_scripts', 'djangocms')()
File "c:\users\pc4\desktop\site14\env\lib\site-packages\djangocms_installer\main.py", line 41, in execute
django.setup_database(config_data)
File "c:\users\pc4\desktop\site14\env\lib\site-packages\djangocms_installer\django\__init__.py", line 404, in setup_database
env=env
File "c:\python27\Lib\subprocess.py", line 535, in check_call
retcode = call(*popenargs, **kwargs)
File "c:\python27\Lib\subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "c:\python27\Lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "c:\python27\Lib\subprocess.py", line 958, in _execute_child
startupinfo)
TypeError: environment can only contain strings
Changing to Linux is not an option.
If i understand MRJob correctly, you can simulate hadoop's multi process run using MRJob by running it with
python mrfile.py -r local input.txt
I'm running windows(no choice for now), and when I issue the above command, i'm getting a bunch of mambo jumbo and at the end it tells me :
WindowsError: [Error 2] The system cannot find the file specified
This is the full error. Could someone help?
C:\Users\someuser\Documents\Python_projects\something>python MRJob_parser.py -r loc
al test2.txt
no configs found; falling back on auto-configuration
no configs found; falling back on auto-configuration
creating tmp directory c:\users\someuser\appdata\local\temp\MRJob_parser.someuser.
20150701.211822.496000
writing wrapper script to c:\users\someuser\appdata\local\temp\MRJob_parser.bw401
45.20150701.211822.496000\setup-wrapper.sh
writing to c:\users\someuser\appdata\local\temp\MRJob_parser.someuser.20150701.211
822.496000\step-0-mapper_part-00000
> sh -ex setup-wrapper.sh 'c:\Users\someuser\Documents\python_venv\something_Project\
Scripts\python.exe' MRJob_parser.py --step-num=0 --mapper 'c:\users\someuser\appd
ata\local\temp\MRJob_parser.someuser.20150701.211822.496000\input_part-00000' > c
:\users\someuser\appdata\local\temp\MRJob_parser.someuser.20150701.211822.496000\s
tep-0-mapper_part-00000
Traceback (most recent call last):
File "MRJob_parser.py", line 18, in <module>
Extractor.run()
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\job.py", line 461, in run
mr_job.execute()
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\job.py", line 479, in execute
super(MRJob, self).execute()
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\launch.py", line 151, in execute
self.run_job()
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\launch.py", line 214, in run_job
runner.run()
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\runner.py", line 464, in run
self._run()
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\sim.py", line 173, in _run
self._invoke_step(step_num, 'mapper')
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\sim.py", line 260, in _invoke_step
working_dir, env)
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\local.py", line 147, in _run_step
procs_args, output_path, working_dir, env)
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\local.py", line 250, in _invoke_processes
cwd=working_dir, env=env)
File "c:\Users\someuser\Documents\python_venv\something_Project\lib\site-packages\m
rjob\local.py", line 73, in _chain_procs
proc = Popen(args, **proc_kwargs)
File "C:\Python27\Lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "C:\Python27\Lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
C:\Users\someuser\Documents\Python_projects\something>
From https://github.com/Yelp/mrjob:
# locally
python mrjob/examples/mr_word_freq_count.py README.rst > counts
My guess is that you don't have to pass in the local runner option and that's causing some kind of error.
I'm trying to build jsoncpp's documentation (https://github.com/open-source-parsers/jsoncpp) in Ubuntu 14.10. As said in the github's README.md, I run the doxybuild.py script but I get the following error :
$> cd jsoncpp/
$> python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
Deleting directory: dist/doxygen
Running: /home/jeremy/Projets/Perso/CmdSeries/libs/jsoncpp/doc/doxyfile
Traceback (most recent call last):
File "doxybuild.py", line 169, in <module>
main()
File "doxybuild.py", line 166, in main
build_doc( options )
File "doxybuild.py", line 116, in build_doc
ok = run_doxygen( options.doxygen_path, 'doc/doxyfile', 'doc', is_silent=options.silent )
File "doxybuild.py", line 67, in run_doxygen
process = subprocess.Popen( cmd )
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
$> sudo python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
Deleting directory: dist/doxygen
Running: /home/jeremy/Projets/Perso/CmdSeries/libs/jsoncpp/doc/doxyfile
Traceback (most recent call last):
File "doxybuild.py", line 169, in <module>
main()
File "doxybuild.py", line 166, in main
build_doc( options )
File "doxybuild.py", line 116, in build_doc
ok = run_doxygen( options.doxygen_path, 'doc/doxyfile', 'doc', is_silent=options.silent )
File "doxybuild.py", line 67, in run_doxygen
process = subprocess.Popen( cmd )
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Does anyone have an idea ?
Already tried :
chmod u+x doxybuild.py
sudo chmod 775 /usr/lib/python2.7/subprocess.py
sudo chown $USER /usr/lib/python2.7/subprocess.py
But nothing resolved my problem.
Ok, problem solved :
$> cd jsoncpp/doc
$> cat readme.txt
The documentation is generated using doxygen (http://www.doxygen.org).
$> sudo apt-get install doxygen
...
OK
$> python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
...
ok
Just install doxygen and building the documentation will work.