I get "SyntaxError" for rst2pdf command after installing RST2PDF in Windows 7 - rst2pdf

After I install RST2PDF in Windows 7, and run the command rst2pdf or rst2pdf -h, it says
SyntxError: Invalid syntax
I installed rst2pdf V.93 using PIP and have set the path to scripts in python directory.
Here is the error:
c:>rst2pdf Traceback (most recent call last): File
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\Scripts\rst2pd
f-script.py", line 9, in
load_entry_point('rst2pdf===0.93.dev-r0', 'console_scripts', 'rst2pdf')() File
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name) File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 2682, in load_entry_point
return ep.load() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 2355, in load
return self.resolve() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\pkg_resources__init__.py", line 2361, in resolve
module = import(self.module_name, fromlist=['name'], level=0) File
"C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa
ges\rst2pdf\createpdf.py", line 695
except ValueError, v:
^ SyntaxError: invalid syntax

The syntax for exception handling changed with python 3: instead of except ValueError, v one must use except ValueError as v.
Apparently, rst2pdf has no support for python3. To use it, you must have python2.7 installed. Some attempts have been made to port rst2pdf, but the efforts seem to have stalled.
Alternatively, you may try to use pandoc, as suggested here

Related

CalledProcessError while installing Tensorflow using Bazel

I am trying to install Tensorflow from source using Bazel on Raspberry pi. I am following the official documentation as given here. When I run the ./configure in Tensorflow directory after completing all the steps written for Bazel, I get the following error
/home/cvit/bin/bazel: line 88: /home/cvit/.bazel/bin/bazel-real: cannot execute binary file: Exec format error
/home/cvit/bin/bazel: line 88: /home/cvit/.bazel/bin/bazel-real: Success
Traceback (most recent call last):
File "./configure.py", line 1552, in <module>
main()
File "./configure.py", line 1432, in main
check_bazel_version('0.15.0')
File "./configure.py", line 450, in check_bazel_version
curr_version = run_shell(['bazel', '--batch', '--bazelrc=/dev/null', 'version'])
File "./configure.py", line 141, in run_shell
output = subprocess.check_output(cmd)
File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['bazel', '--batch', '--bazelrc=/dev/null', 'version']' returned non-zero exit status 1
I didn't put the user flag in the bazel installation. So, I think this might be bazelrc error so I tried to set $PATH=$BAZEL/bin but nothing happened.
Please give any suggestion !!
Probably the problem is that the non appropriate version of bazel is installed.
Run bazel version in the tensorflow directory, and see if there is an error.
If there is a problem with bazel version, then check out the .baselversion file, and if it contains a version that isn't installable with apt, then dowload the installer from https://github.com/bazelbuild/bazel/releases then install it, else install with apt.
After that everything should work fine.

why runtime error happen? After import Mecab

what is problem?
I use python3 windows10 environment is Anaconda
m=MeCab.Tagger("-Ochasen")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\a.sakata\Anaconda3\lib\site-packages\MeCab.py", line 253, in __init__
_MeCab.Tagger_swiginit(self, _MeCab.new_Tagger(*args))
RuntimeError
Your dicrc probably doesn't include the chasen format. This causes the Mecab C lib to die with an error, which results in the runtime error in Python.
I get the same error, and if I run mecab on the command line I get this output:
$ mecab -Ochasen
writer.cpp(63) [!tmp.empty()] unkown format type [chasen]
If you don't get an error on the command line the cause might be something else.

JHBuild runtime error "Failed to close %s stream" (MacOS)

I started a JHBuild with the wrong arguments (forgot 'build') and hit control-C at what appears to have been the wrong moment.
Now when I try any JHBuild command, e.g. jhbuild bootstrap, I get:
Traceback (most recent call last):
File "/Users/gnucashdev/Source/jhbuild/jhbuild/config.py", line 197, in load
execfile(filename, config)
File "/Users/gnucashdev/.jhbuildrc", line 408, in <module>
execfile(_userrc)
File "/Users/gnucashdev/.jhbuildrc-custom", line 22, in <module>
setup_sdk()
File "/Users/gnucashdev/.jhbuildrc", line 260, in setup_sdk
gcc = _popen("xcrun -f gcc")
File "/Users/gnucashdev/.jhbuildrc", line 41, in _popen
raise RuntimeError, "Failed to close %s stream" % cmd_arg
RuntimeError: Failed to close xcrun -f gcc stream
jhbuild: could not load config file
I've tried re-installing jhbuild with
./gtk-osx-build-setup.sh
but the next step - i.e.
jhbuild bootstrap
yields the above error. Some file appears to have been compromised, perhaps truncated. But I'm having a hard time figuring out which.
I had the same error. xcrun is returning an error, probably due to an incorrect environment variable. In my case, I was running jhbuild while in a jhbuild shell, which caused the SDKDIR environment variable to contain 2 copies of the path to the SDK directory. Exiting the jhbuild shell fixed the problem.

Error loading library gpuarray with Theano

I am trying to run this script to test Theano's use of my GPU and get the following error:
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-
packages/theano/gpuarray/__init__.py", line 164, in <module>
use(config.device)
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-
packages/theano/gpuarray/__init__.py", line 151, in use
init_dev(device)
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-
packages/theano/gpuarray/__init__.py", line 60, in init_dev
sched=config.gpuarray.sched)
File "pygpu/gpuarray.pyx", line 614, in pygpu.gpuarray.init
(pygpu/gpuarray.c:9419)
File "pygpu/gpuarray.pyx", line 566, in pygpu.gpuarray.pygpu_init
(pygpu/gpuarray.c:9110)
File "pygpu/gpuarray.pyx", line 1021, in
pygpu.gpuarray.GpuContext.__cinit__ (pygpu/gpuarray.c:13472)
pygpu.gpuarray.GpuArrayException: Error loading library: -1
I need to use the nvidia-381 driver since my GPU is a 1080 ti and is not compatible with nvidia-375. I'm not sure if that matters but installing nvcc overwrites 381 and causes some errors if I reinstall 381 after setting up nvcc so I can't use nvcc.
I can import pygpu without errors but if I run pygpu.test() I get the following error and I don't know how to specify the DEVICE variable without nvcc.
======================================================================
ERROR: Failure: RuntimeError (No test device specified. Specify one using the DEVICE or GPUARRAY_TEST_DEVICE environment variables.)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/me/anaconda3/envs/py35/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/me/anaconda3/envs/py35/lib/python3.5/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/home/me/anaconda3/envs/py35/lib/python3.5/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/me/.local/lib/python3.5/site-packages/pygpu-0.6.2-py3.5-linux-x86_64.egg/pygpu/tests/test_tools.py", line 5, in <module>
from .support import (guard_devsup, rand, check_flags, check_meta, check_all,
File "/home/me/.local/lib/python3.5/site-packages/pygpu-0.6.2-py3.5-linux-x86_64.egg/pygpu/tests/support.py", line 32, in <module>
context = gpuarray.init(get_env_dev())
File "/home/me/.local/lib/python3.5/site-packages/pygpu-0.6.2-py3.5-linux-x86_64.egg/pygpu/tests/support.py", line 29, in get_env_dev
raise RuntimeError("No test device specified. Specify one using the DEVICE or GPUARRAY_TEST_DEVICE environment variables.")
RuntimeError: No test device specified. Specify one using the DEVICE or GPUARRAY_TEST_DEVICE environment variables.
----------------------------------------------------------------------
Ran 7 tests in 0.003s
FAILED (errors=7)
<nose.result.TextTestResult run=7 errors=7 failures=0>
Warning: its entirely possible that this is all wrong and the actual reason for your problem is in fact - as you suspect - your gpu driver.
I had the same issue with gpuarray on Windows 10.
In the end I solved it by:
completely uninstall python
install cuda 8.0 (with cudnn 5.1)
install anaconda
install theano through anaconda:
conda install theano pygpu
As you are using linux: This error message basically means It didn't work, don't ask me why And is mostly shown if something with your setup is wrong (e.g. different compilers used for compiling python and theano, or incompatible cuda version)
I would recommend to update to cuda 8.0 and to reinstall your python environment over anaconda (just in case)
On a side note: I tested your example script from the docu and at least that is working....
Note for windows users: Never try to install Anaconda in a location where you have spaces in the path... Everything looks fine ... until theano starts having trouble finding and compiling things.
Note regarding the pygpu.test():
Normally you just set the environment variable:
windows: set DEVICE=cuda
linux: export DEVICE=cuda
BUT The test has the habit of saying you didn't specify a device if the library couldn't be loaded...

Yum broken on RHEL 6

Using 64-bit RHEL 6, receiving this error from Yum:
[root /]# yum install [package_name]
---Start Error---
<BR><BR>
Traceback (most recent call last):<BR>
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 288, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 140, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 436, in doCommands
self._getTs(needTsRemove)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs
self._getTsInfo(remove_only)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo
pkgSack = self.pkgSack
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 887, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 669, in _getSacks
self.repos.populateSack(which=repos)
File "/usr/lib/python2.6/site-packages/yum/repos.py", line 308, in populateSack
sack.populate(repo, mdtype, callback, cacheonly)
File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 187, in populate
dobj = repo_cache_function(xml, csum)
File "/usr/lib64/python2.6/site-packages/sqlitecachec.py", line 46, in getPrimary
self.repoid))
TypeError: Parsing primary.xml error: Start tag expected, '<' not found
---End Error---
Just started today. Was working just fine a couple days ago. Haven't installed anything on this system since last use.
Have already rebuilt Python 2.6 and Yum 3.4.3. Still same errors as above. Any ideas?
Clear the repo cache and rebuild it
yum clean all
yum update
Run this:
sudo su
export LD_LIBRARY_PATH=/usr/lib64:/usr/local/lib
yum clean all
yum update yum
I think this fixes it. It worked for me.