Mindmeld gazetteer build failes with 'list' object has no attribute 'get' - mindmeld

Following docs from mindmeld.com(Step 7):
from mindmeld.components.nlp import NaturalLanguageProcessor
nlp = NaturalLanguageProcessor('.')
nlp.build()
Results in error:
self.build_gazetteer(gaz_name, force_reload=force_reload)
File "/home/sar/test/lib/python3.6/site-packages/mindmeld/resource_loader.py", line 214, in
build_gazetteer
mapping.get("entities", []), self.query_factory.normalize
AttributeError: 'list' object has no attribute 'get'
Obviously, list has no .get(), I assume nlp.build() should have made a dictionary, but fails to do so. Anyone else experienced this? Tested on Ubuntu 18.04, Python 3.6.9.
EDIT: Found this old post of mine, worked it out. I don't remember details, but nlp doesn't support Python > 3.7, custom Python version in virtual environment fixed this.

problem was incompatible Python version for MindMeld, using Python 3.6 or 3.7 fixed this

Related

Mypy raises syntax error with pydrake stub

When I try to run mypy in my project that has PyDrake as a depencency I get: venv/lib/python3.9/site-packages/pydrake/common/eigen_geometry.pyi:30: error: invalid syntax
The line in questions is: def cast[AutoDiffXd](self, *args, **kwargs) -> Any: .... I'm assuming this has something to do with PyDrake's custom templating system. How can I make MyPy and PyDrake play nice?
Environment Info
OS: Ubuntu 20.04
Python version: 3.9.16
MyPy version: 0.991
Drake version: 1.11.0
As of the current version of Drake (v1.12.0), we unfortunately do not support Mypy. The purpose of the *.pyi files as of today is solely to enable VSCode suggestion auto-complete.
We didn't have a central issue tracking this, so I've filed a new one. Hopefully we can remove the syntax errors down the road.
The only work-around I know of for today is to delete the *.pyi files if you use Mypy.

Cannot get mPdf working

I use composer require mpdf/mpdf to install it.
when trying example I got error:
Parse error: syntax error, unexpected '.', expecting '&' or variable
(T_VARIABLE) in /var/www/randomizer/library/mpdf/src/functions-dev.php
on line 4
hope someone can help me with this issue.
Ensure you are running PHP5.6 or higher when attempting to run the examples. Your CLI might be a different version which is why it didn't complain when you installed Mpdf via composer.

error in julia - pyplot - error 6034

i am starting to use Julia and i have to do plot. When i call PyPlot in Julia, appears the error 6034.
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
I tried to reinstall, downgrade, upgrade julia, I use atom to write. How could i proceed ? o use pkg.add ,pkg.build , pkg.update, pycall.
Is there a phyton problem ? or a gfortran problem ?
using the solution suggested in the other question does not solve my problem. When I try to set
ENV("PYTHON")
I get the following error:
MethodError: objects of type Base.EnvHash are not callable

"TypeError: expected bytes, str found" when calling .MidiIn() from rtmidi-python

I installed rtmidi_python for Python 3.4.2 from the .whl provided on http://www.lfd.uci.edu/~gohlke/pythonlibs/, and the import works fine, but as soon as I call "rtmidi_python.MidiIn()", I get a TypeError as follows:
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import rtmidi_python
>>> rtmidi_python.MidiIn()
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
rtmidi_python.MidiIn()
File "rtmidi_python.pyx", line 72, in rtmidi_python.MidiIn.__cinit__ (rtmidi_python.cpp:1440)
TypeError: expected bytes, str found
As I understand, after some research, this means that the there's a mistake somewhere in the package itself or in the build of it, and there's nothing I can do about it, but I might be wrong. Can anyone confirm?
I use 3.4.2 because that is the version of Python used by the current version of Blender. I want to use rtmidi-python within the Blender Game Engine.
I am currently working on Windows 7 32 bit, and use .whls to install packages as I do not have the necessary C++ compiler for regular pip installs.
For comparison, I previously installed rtmidi-python for 3.5.1, also from the adequate .whl provided on the link above, and there the command worked perfectly fine.
Should any necessary information be missing, feel free to ask. Thanks ahead if the answer comes as a comment and I don't get to upvote it.
While not a perfect solution, this can be fixed in the manner described by sehqlr here...https://github.com/superquadratic/rtmidi-python/issues/17
...by calling MidiIn() like this:
>>> rtmidi_python.MidiIn(b'in')

Julia error: no method haskey(Dict{String,Dict{String,String}},ASCIIString)

I'm trying to test out the Winston plotting engine in Julia. I installed the package but I'm getting some errors now when I try to compile one of the examples:
> julia example1.jl
Warning: could not import Base.haskey into Inifile
Warning: could not import Graphics.set_source into Color
ERROR: no method haskey(Dict{String,Dict{String,String}},ASCIIString)
in read at /Users/thinkpad20/.julia/IniFile/src/IniFile.jl:41
in read at /Users/thinkpad20/.julia/IniFile/src/IniFile.jl:67
in anonymous at /Users/thinkpad20/.julia/Winston/src/Winston.jl:39
in include_from_node1 at loading.jl:88
in reload_path at loading.jl:111
in require at loading.jl:46
in include_from_node1 at loading.jl:88
in process_options at client.jl:253
in _start at client.jl:334
at /Users/thinkpad20/.julia/Winston/src/Winston.jl:31
at /Users/thinkpad20/.julia/Winston/examples/example1.jl:3
can anyone tell me what's going on? It seems to be that it can't find Base.haskey, but I'm not sure how to address that.
Try inspecting Base.VERSION
haskey was introduced in Julia v0.2 (still pre-release as of this writing), I suspect that you are running a version 0.1.x
The real problem is inside of the Winston package. It sounds like they have their REQUIRES information set up wrong. You should file an issue here: https://github.com/nolta/Winston.jl
You can also download pre-release version of 0.2 for windows and mac here: https://code.google.com/p/julialang/downloads/list

Resources