jsoncpp : error while building the documentation - python

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.

Related

FileNotFoundError: [Errno 2] No such file or directory: 'python'

I'm trying to to write a simple python app and launch it using TorchX following this Quickstart guide. Following commands are executed in my home directory:
pip3 install "torchx[dev]"
Write a simple python program using vim editor vi my_app.py
# my_app.py
%%writefile my_app.py
import sys
print(f"Hello, {sys.argv[1]}!")
Execute the app via torchx run as torchx run --scheduler local_cwd utils.python --script my_app.py "your name".
And then I get a long error:
Log files located in: /var/folders/h7/qrsyzj5s7hvbkwmv83by9wgc0000gn/T/torchx_hykfxkz3/torchx/torchx_utils_python-vxm9hhpt3k7wtd/python/0
Traceback (most recent call last):
File "/usr/local/bin/torchx", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/torchx/cli/main.py", line 110, in main
run_main(get_sub_cmds(), argv)
File "/usr/local/lib/python3.9/site-packages/torchx/cli/main.py", line 106, in run_main
args.func(args)
File "/usr/local/lib/python3.9/site-packages/torchx/cli/cmd_run.py", line 271, in run
self._run(runner, args)
File "/usr/local/lib/python3.9/site-packages/torchx/cli/cmd_run.py", line 232, in _run
app_handle = runner.run_component(
File "/usr/local/lib/python3.9/site-packages/torchx/runner/api.py", line 147, in run_component
return self.schedule(dryrun_info)
File "/usr/local/lib/python3.9/site-packages/torchx/runner/api.py", line 225, in schedule
app_id = sched.schedule(dryrun_info)
File "/usr/local/lib/python3.9/site-packages/torchx/schedulers/local_scheduler.py", line 748, in schedule
replica = self._popen(
File "/usr/local/lib/python3.9/site-packages/torchx/schedulers/local_scheduler.py", line 688, in _popen
proc = subprocess.Popen(
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python'
I have Python 3.9.13 installed on macOS Monterey (version 12.4).
What could be a cause of this error?

Infinite loop that fills tmp folder in Ubuntu with Selenium

Just created a fresh install of Ubuntu. Installed python and selenium, went to run this code:
#!/usr/bin/env python
from selenium import webdriver
browser = webdriver.Firefox('/usr/bin/')
browser.get('http://www.ubuntu.com/')
browser.close()
browser.quit()
when i run it, it just hangs in the terminal and then when I press Control-C it says:
^CTraceback (most recent call last):
File "test.py", line 5, in <module>
browser = webdriver.Firefox('/usr/bin/')
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 127, in __init__
firefox_profile = FirefoxProfile(firefox_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 78, in __init__
ignore=shutil.ignore_patterns("parent.lock", "lock", ".parentlock"))
File "/usr/lib/python2.7/shutil.py", line 189, in copytree
copytree(srcname, dstname, symlinks, ignore)
File "/usr/lib/python2.7/shutil.py", line 189, in copytree
copytree(srcname, dstname, symlinks, ignore)
File "/usr/lib/python2.7/shutil.py", line 189, in copytree
copytree(srcname, dstname, symlinks, ignore)
File "/usr/lib/python2.7/shutil.py", line 192, in copytree
copy2(srcname, dstname)
File "/usr/lib/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 84, in copyfile
copyfileobj(fsrc, fdst)
KeyboardInterrupt
If I don't kill the program and it fills my tmp folder for some reason.
I have tried installing selenium three different times across different VMs, using venv, moving selenium all of the place. I am LOST.
Any help is greatly appreciated!!
EDIT: I removed the '/usr/bin/' per #L3viathan and ran it. My new error is:
Traceback (most recent call last):
File "test.py", line 5, in <module>
browser = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 64, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
Couldn't make anything work anymore so I started up another fresh Ubuntu VM and have only done the following commands.
$ sudo apt-get install python-pip
$ sudo pip install selenium
And then I ran my program and got the geckodriver error. So I downloaded the geckodriver. and moved it to /usr/bin/
$ sudo cp geckodriver /usr/bin/
ran program and get EXACT same error:
Traceback (most recent call last):
File "test.py", line 5, in <module>
browser = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 64, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

Errors installing Pyrouge

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} "

cannot run python MRJob locally

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.

sudo virtualenv -p gives PermissionError: [Errno 13] Permission denied?

When I try to run
sudo virtualenv -p /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS
It shows the following error:
Running virtualenv with interpreter
/Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.8.2', 'console_scripts', 'virtualenv')()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/virtualenv.py", line 897, in main
popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/subprocess.py", line 818, in __init__
restore_signals, start_new_session)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/subprocess.py", line 1416, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
I tried removing my pip.log file as this answer advised me to, but the problem persists. Any solutions?
Edit:
I should explain that I'm trying to create a virtualenv located at the <path name> because I want to install a package with pip for that version of Python.

Categories