We are using Powerpoint and Restructured Text together with Python-Sphinx. I was asking myself, if it is possible to create slides using ReST.
I found the interesting Tool rst2html5slides on
https://rst2html5slides.readthedocs.io/en/latest/index.html.
I installed the tool with:
pip install rst2html5slides
This worked without problems.
Now, I was unable to use the tool. Typing rst2html5slides on my console gives:
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\rst2html5slides.exe\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\rst2html5slides.py", line 16, in <module>
from rst2html5 import HTML5Translator, HTML5Writer
ImportError: No module named rst2html5
Typing pip list issues:
rst2html5 1.9.4
rst2html5slides 1.0
After inspecting my c:\python27\lib\site-packages\ directory I found out, that there is an rst2html5slides_.py, but no rst2html5slides.py. So I tried to just rename this file.
No it was possible for me to start rst2html5slides --traceback presentation.txt simple_deck.html, but I just have another problem.
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\rst2html5slides.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\rst2html5slides.py", line 484, in main
publish_cmdline(writer=SlideWriter(), description=description)
File "c:\python27\lib\site-packages\docutils\core.py", line 352, in publish_cmdline
config_section=config_section, enable_exit_status=enable_exit_status)
File "c:\python27\lib\site-packages\docutils\core.py", line 219, in publish
output = self.writer.write(self.document, self.destination)
File "c:\python27\lib\site-packages\docutils\writers\__init__.py", line 80, in write
self.translate()
File "c:\python27\lib\site-packages\rst2html5slides.py", line 200, in translate
HTML5Writer.translate(self)
File "c:\python27\lib\site-packages\rst2html5.py", line 227, in translate
self.document.walkabout(visitor)
File "c:\python27\lib\site-packages\docutils\nodes.py", line 187, in walkabout
visitor.dispatch_departure(self)
File "c:\python27\lib\site-packages\docutils\nodes.py", line 1895, in dispatch_departure
return method(node)
File "c:\python27\lib\site-packages\rst2html5slides.py", line 294, in depart_document
self._ordered_tag_attributes(deck,
AttributeError: SlideTranslator instance has no attribute '_ordered_tag_attributes'
AttributeError: SlideTranslator instance has no attribute '_ordered_tag_attributes'
Exiting due to error. Use "--traceback" to diagnose.
Please report errors to <docutils-users#lists.sf.net>.
Include "--traceback" output, Docutils version (0.12 [release]),
Python version (2.7.10), your OS type & version, and the
command line used.
What I'm doing wrong here?
rst2html5slides' author here. I've updated the package a while ago. Please, update it and it should run.
Related
So, I am trying to install, and run Mujoco-py on my ubuntu. Everything went well but, I cant install the libglew1.5. I searche for it in the Ubuntu Package Archives, but no luck. Then I skipped that part, but when im trying to run the example its giving me this error.
(mujoco_py) user#user:~/.mujoco/mujoco-py/examples$ python3 setting_state.py
Creating window glfw
libEGL warning: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libEGL warning: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
GLFW error (code %d): %s 65542 b'EGL: Failed to initialize EGL: EGL is not or could not be initialized'
Traceback (most recent call last):
File "setting_state.py", line 32, in <module>
viewer = MjViewer(sim)
File "/home/sazzad14/.mujoco/mujoco-py/mujoco_py/mjviewer.py", line 137, in __init__
super().__init__(sim)
File "/home/sazzad14/.mujoco/mujoco-py/mujoco_py/mjviewer.py", line 28, in __init__
super().__init__(sim)
File "mjrendercontext.pyx", line 311, in mujoco_py.cymj.MjRenderContextWindow.__init__
File "mjrendercontext.pyx", line 46, in mujoco_py.cymj.MjRenderContext.__init__
File "mjrendercontext.pyx", line 102, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
File "opengl_context.pyx", line 48, in mujoco_py.cymj.GlfwContext.__init__
File "opengl_context.pyx", line 99, in mujoco_py.cymj.GlfwContext._create_window
mujoco_py.cymj.GlfwError: Failed to create GLFW window
I installed libglew2.2, but that does not help.
The game is running fine from source code. When I used cx_Freeze to compile the binary file on the Linux I got into error on the second machine:
~/tmp/exe.linux-x86_64-2.7 $ ./rungame
/home/local/tmp/exe.linux-x86_64-2.7/library.zip/lib/MenuItem.py:13: RuntimeWarning: use font: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory
(ImportError: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory)
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
File "rungame.py", line 10, in <module>
File "/lib/gameloop.py", line 13, in <module>
File "/lib/settings.py", line 10, in <module>
File "/lib/menuitem.py", line 13, in <module>
File "/usr/lib64/python2.7/site-packages/pygame/__init__.py", line 74, in __getattr__
NotImplementedError: font module not available
(ImportError: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory)
On the machine where I compile the binary it runs fine. Could someone advice me.
Run this : sudo apt-get install libsdl-ttf2.0-0
I'm trying to use Cython. I use setup.py and build as opposed to letting pyximport do this. However, every time I import my module it seems pyximport is called. Pyximport fails to build and everything crashes.
I use Spyder. I do not have a single reference to pyximport in my project, but Spyder does not seem to care and keeps calling pyximprot.
I called my program from the command window (outside Spyder) and it ran just fine.
How can i get rid of the call to pyximport? Or is something else going on?
import c_result
Traceback (most recent call last):
File "<ipython-input-2-3e92d1c50179>", line 1, in <module>
import c_result
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 458, in load_module
language_level=self.language_level)
File "C:\Users\xxxR\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 231, in load_module
raise exc.with_traceback(tb)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 185, in run
_build_ext.build_ext.run(self)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 192, in build_extensions
ext.sources = self.cython_sources(ext.sources, ext)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 327, in cython_sources
self.mkpath(os.path.dirname(target))
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\distutils\cmd.py", line 338, in mkpath
dir_util.mkpath(name, mode, dry_run=self.dry_run)
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\distutils\dir_util.py", line 74, in mkpath
"could not create '%s': %s" % (head, exc.args[-1]))
ImportError: Building module c_result failed: ["distutils.errors.DistutilsFileError: could not create 'C:\\Windows\\system32\\config\\systemprofile': Kan ikke opprette en fil når filen allerede finnes\n"]
The problem appeared in Spyder because the package's initialization actually loads pyximport and calls pyximport.install(), in the file utils/site/sitecustomize.py.
Other have complained about it on GitHub:
spyder issue #5299
spyder issue #5087
A solution that is not elegant (will not survive updates of spyder, for instance) but that should work is to manually edit the sitecustomize.py file in your spyder installation and remove the section under if HAS_PYXIMPORT:
(Spyder maintainer here) This problem was fixed in our 3.2.8 version, released on March 2018.
I want Pyramid, Python3, SQLAlchemy and MySQL to play nice on a single machine. This question has been asked before, but it was a long enough time ago that I'm hoping the answer has changed...
Questions:
What driver works for getting a Python 3 Pyramid app to talk nicely to MySQL via SQLAalchemy? Is this even possible?
I've gotten quite far in this project thinking it would be a simple thing to switch out databases, now I'm a bit stuck and downgrading to Python 2.7 is not something I want to have to go through. So my second question is:
If there is no way to talk to MySQL nicely without downgrading, is there a database that Python 3 is ready for (besides SQLite)?
Or lastly, how would I overcome any of the problems mentioned in the 'Stuff I've Tried' section below?
Stuff I've Tried:
PyMySQL
I have PyMySQL installed and I even got it to complain about incorrect passwords and a missing database so it's getting something right. But when I tried to initialize my database (using initialize_foo_db) everything went sour:
2013-02-06 17:18:31,282 INFO [sqlalchemy.engine.base.Engine][MainThread] b'SELECT DATABASE()'
2013-02-06 17:18:31,282 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
Traceback (most recent call last):
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 719, in _do_get
return self._pool.get(wait, self._timeout)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/util/queue.py", line 137, in get
raise Empty
sqlalchemy.util.queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../bin/initialize_mega_db", line 9, in <module>
load_entry_point('mega==0.0', 'console_scripts', 'initialize_mega_db')()
File "/home/sheena/MegaCatalogue/env/mega/mega/scripts/initializedb.py", line 46, in main
Base.metadata.create_all(engine)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/schema.py", line 2567, in create_all
tables=tables)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 2301, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 2492, in contextual_connect
self.pool.connect(),
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 224, in connect
return _ConnectionFairy(self).checkout()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 387, in __init__
rec = self._connection_record = pool._do_get()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 741, in _do_get
con = self._create_connection()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 188, in _create_connection
return _ConnectionRecord(self)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 273, in __init__
pool.dispatch.first_connect.exec_once(self.connection, self)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/event.py", line 279, in exec_once
self(*args, **kw)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/event.py", line 288, in __call__
fn(*args, **kw)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/strategies.py", line 168, in first_connect
dialect.initialize(c)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/dialects/mysql/base.py", line 1999, in initialize
default.DefaultDialect.initialize(self, connection)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/default.py", line 177, in initialize
self._get_default_schema_name(connection)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/dialects/mysql/base.py", line 1964, in _get_default_schema_name
return connection.execute('SELECT DATABASE()').scalar()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1628, in _execute_text
statement, parameters
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1691, in _execute_context
context)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/default.py", line 333, in do_execute
cursor.execute(statement, parameters)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/PyMySQL3-0.5-py3.2.egg/pymysql/cursors.py", line 108, in execute
query = query % escaped_args
TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
oursql
I tried installing oursql using pip install -r file
where file contains:
#oursql==0.9.3 but need special Python 3 build https://bugs.launchpad.net/oursql/+bug/1051512
https://launchpad.net/oursql/py3k/py3k-0.9.3/+download/oursql-0.9.3.zip
pyramid==1.3.4
And I got:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
myconnpy
This installs without error but I can't seem to find out what I should tell SQLAlchemy to look for. In the appropriate settings.ini file I have tried:
sqlalchemy.url = mysql+myconnpy://...
as well as a bunch of other things. Google is failing me on this one...
UPDATE - a semblance of progress
I've managed to install oursql build dependencies:
sudo aptitude install python-pip libmysqlclient-dev
I then downloaded oursql0.9.3 and ran:
setup.py install
The output was this:
cython not found, using previously-cython'd .c file.
running install
running build
running build_ext
running install_lib
copying build/lib.linux-x86_64-3.2/oursql.cpython-32mu.so -> /home/sheena/MegaCatalogue/env/lib/python3.2/site-packages
running install_egg_info
Writing /path/to/virtualenv/foo/lib/python3.2/site-packages/oursql-0.9.3.egg-info
I opened a shell and apparently the module doesn't exist - it can't be imported anyway. But for some reason it is listed if I say help() then modules
When using the hg serve command in windows, the server starts correctly, but when somebody tries to do a clone, this error appears.
$ hg serve
listening at http://machineX:8000/ (bound to *:8000)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 4456)
Traceback (most recent call last):
File "SocketServer.pyc", line 558, in process_request_thread
File "SocketServer.pyc", line 320, in finish_request
File "mercurial\hgweb\server.pyc", line 42, in __init__
File "SocketServer.pyc", line 615, in __init__
File "BaseHTTPServer.pyc", line 329, in handle
File "BaseHTTPServer.pyc", line 323, in handle_one_request
File "mercurial\hgweb\server.pyc", line 74, in do_GET
File "mercurial\hgweb\server.pyc", line 65, in do_POST
File "mercurial\hgweb\server.pyc", line 58, in do_write
File "mercurial\hgweb\server.pyc", line 122, in do_hgweb
File "mercurial\hgweb\hgweb_mod.pyc", line 85, in __call__
File "mercurial\hgweb\hgweb_mod.pyc", line 117, in run_wsgi
ErrorResponse
----------------------------------------
It seems this is some sort of python error... I've already tried reinstalling to the lastest version of mercurial, but still the same problem occurs.
anybody else seen this before?
thanks!
It a dumb problem...
I was doing hg serve on my "hello" repository, and I was trying to access it as
hg clone http://machine:8000/hello
you shouldn't use the repo name in the address...
that is all.