Nuitka Dependancy Error - python

I'm trying to compile a simple standalone python application using Nuitka. I was able to do this using just the standard library.
I'm now looking to bring in some extra dependancies but I am now receiving errors from Nuitka I'm unable to interpret.
I've tried to import numpy into the project which looks like:
Structure:
npg
__init__.py
__main__.py
Pipfile
Pipfile.lock
Here's the __main__.py
import numpy as np
def main():
print('hello Nuitka')
print('hello numpy', np.__version__)
if __name__ == '__main__':
main()
I then run python -m nuitka npg/__main__.py --standalone and get the error:
Nuitka:WARNING:/usr/local/lib/python3.6/site-packages/numpy/testing/_private/pytesttester.py:125: Cannot find 'pytest' in package 'numpy.testing._private' as absolute import (tried pytest).
Nuitka:WARNING:/usr/local/lib/python3.6/site-packages/setuptools/command/egg_info.py:20: Cannot find 'setuptools.extern.six.moves' in package 'setuptools.command' as absolute import (tried setuptools.extern.six.moves).
Nuitka:WARNING:/usr/local/lib/python3.6/site-packages/setuptools/command/egg_info.py:20: Cannot find 'setuptools.extern.six' in package 'setuptools.command' as absolute import (tried setuptools.extern.six).
Nuitka:WARNING:/usr/local/lib/python3.6/site-packages/setuptools/glob.py:13: Cannot find 'setuptools.extern.six' in package 'setuptools' as absolute import (tried setuptools.extern.six).
Nuitka:WARNING:Problem at '<SourceCodeReference to /usr/src/app/npg/__main__.py:4>' with FunctionDef(name='main', args=arguments(args=[], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[]), body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Str(s='hello Nuitka')], keywords=[])), Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Str(s='hello numpy'), Attribute(value=Name(id='np', ctx=Load()), attr='__version__', ctx=Load())], keywords=[]))], decorator_list=[], returns=None).
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:566:
-> from __main__ import __requires__
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:565:
-> try:
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:559:
-> #classmethod
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:559:
-> #classmethod
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:543:
-> class WorkingSet:
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:543:
-> class WorkingSet:
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:543:
-> class WorkingSet:
Problem with statement at /usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py:543:
-> class WorkingSet:
Nuitka:INFO:Interrupted while working on '<Node 'COMPILED_PYTHON_PACKAGE' with {'filename': '/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py', 'package': None, 'name': 'pkg_resources'}>'.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nuitka/__main__.py", line 218, in <module>
main()
File "/usr/local/lib/python3.6/site-packages/nuitka/__main__.py", line 212, in main
MainControl.main()
File "/usr/local/lib/python3.6/site-packages/nuitka/MainControl.py", line 800, in main
filename = filename
File "/usr/local/lib/python3.6/site-packages/nuitka/MainControl.py", line 152, in createNodeTree
Optimization.optimize(main_module.getOutputFilename())
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 533, in optimize
makeOptimizationPass(initial_pass = True)
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 446, in makeOptimizationPass
changed = optimizeModule(current_module)
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 173, in optimizeModule
changed = optimizeCompiledPythonModule(module)
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 97, in optimizeCompiledPythonModule
module.computeModule()
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ModuleNodes.py", line 461, in computeModule
trace_collection = self.trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 165, in computeStatementsSequence
trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FrameNodes.py", line 195, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/TryNodes.py", line 129, in computeStatement
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 169, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/AssignNodes.py", line 297, in computeStatement
trace_collection.onExpression(self.getAssignSource())
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/OutlineNodes.py", line 247, in computeExpressionRaw
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 169, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/TryNodes.py", line 129, in computeStatement
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 169, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/TryNodes.py", line 129, in computeStatement
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 165, in computeStatementsSequence
trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FrameNodes.py", line 195, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/LocalsDictNodes.py", line 406, in computeStatement
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/NodeBases.py", line 933, in computeStatementSubExpressions
expression = expression
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ExpressionBases.py", line 976, in computeExpressionRaw
expression = trace_collection.onExpression(sub_expression)
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ExpressionBases.py", line 976, in computeExpressionRaw
expression = trace_collection.onExpression(sub_expression)
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ExpressionBases.py", line 976, in computeExpressionRaw
expression = trace_collection.onExpression(sub_expression)
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FunctionNodes.py", line 901, in computeExpressionRaw
function_body.computeFunctionRaw(trace_collection)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FunctionNodes.py", line 408, in computeFunctionRaw
self.computeFunction(trace_collection)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FunctionNodes.py", line 422, in computeFunction
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 169, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/TryNodes.py", line 129, in computeStatement
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 165, in computeStatementsSequence
trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FrameNodes.py", line 195, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/TryNodes.py", line 129, in computeStatement
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/StatementNodes.py", line 169, in computeStatementsSequence
statement = statement
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 575, in onStatement
statement.computeStatement(self)
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/AssignNodes.py", line 297, in computeStatement
trace_collection.onExpression(self.getAssignSource())
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ExpressionBases.py", line 1054, in computeExpressionRaw
expression = sub_expression
File "/usr/local/lib/python3.6/site-packages/nuitka/optimizations/TraceCollections.py", line 550, in onExpression
trace_collection = self
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ExpressionBases.py", line 998, in computeExpressionRaw
trace_collection = trace_collection
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ImportNodes.py", line 400, in computeExpression
module_name = imported_module_name
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ImportNodes.py", line 290, in _attemptRecursion
module_package = module_package
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/ImportNodes.py", line 222, in _consider
reason = reason
File "/usr/local/lib/python3.6/site-packages/nuitka/importing/Recursion.py", line 169, in recurseTo
reason = reason
File "/usr/local/lib/python3.6/site-packages/nuitka/importing/Recursion.py", line 92, in _recurseTo
is_main = False
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/Building.py", line 1055, in createModuleTree
is_main = is_main
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/Building.py", line 760, in buildParseTree
source_ref = source_ref
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/TreeHelpers.py", line 384, in buildStatementsNode
statements = buildNodeList(provider, nodes, source_ref, allow_none = True)
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/TreeHelpers.py", line 338, in buildNodeList
entry = buildNode(provider, node, node_source_ref, allow_none)
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/TreeHelpers.py", line 295, in buildNode
source_ref = source_ref
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/ReformulationFunctionStatements.py", line 153, in buildFunctionNode
source_ref = source_ref
File "/usr/local/lib/python3.6/site-packages/nuitka/tree/ReformulationFunctionStatements.py", line 799, in buildFunctionWithParsing
source_ref = source_ref
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FunctionNodes.py", line 452, in __init__
source_ref = source_ref
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/FunctionNodes.py", line 386, in __init__
setLocalsDictType(self.locals_dict_name, "python3_function")
File "/usr/local/lib/python3.6/site-packages/nuitka/nodes/LocalsScopes.py", line 30, in setLocalsDictType
assert locals_dict_name not in locals_dict_handles, locals_dict_name
AssertionError: locals___main__$$$function_1_main
I'm use how to interpret that error. Looks like it's having problems with the syntax of the Python's standard libraries import machinery.

Related

xlwings recently stopped getting live data from excel via Range

I was running a script to get data from excel for over a year using the Xlwings range command like so...
list=Range('A1:D10').value
Suddenly, it stopper working. I had changed nothing in the code nor the system, other than maybe installing another network card.
This is the error when trying to use the Range assignment now.
Traceback (most recent call last):
File "G:\python32\fetcher.py", line 61, in <module>
listFull = getComData()
File "G:\python32\fetcher.py", line 38, in getComData
listFull=Range('A4:H184').value
File "G:\python32\lib\site-packages\xlwings\main.py", line 1490, in __init__
impl = apps.active.range(cell1).impl
File "G:\python32\lib\site-packages\xlwings\main.py", line 439, in range
return Range(impl=self.impl.range(cell1, cell2))
File "G:\python32\lib\site-packages\xlwings\_xlwindows.py", line 457, in range
xl1 = self.xl.Range(arg1)
File "G:\python32\lib\site-packages\xlwings\_xlwindows.py", line 341, in xl
self._xl = get_xl_app_from_hwnd(self._hwnd)
File "G:\python32\lib\site-packages\xlwings\_xlwindows.py", line 251, in get_xl_app_from_hwnd
disp = COMRetryObjectWrapper(Dispatch(p))
File "G:\python32\lib\site-packages\win32com\client\__init__.py", line 96, in Dispatch
return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, clsctx=clsctx)
File "G:\python32\lib\site-packages\win32com\client\__init__.py", line 37, in __WrapDispatch
klass = gencache.GetClassForCLSID(resultCLSID)
File "G:\python32\lib\site-packages\win32com\client\gencache.py", line 180, in GetClassForCLSID
mod = GetModuleForCLSID(clsid)
File "G:\python32\lib\site-packages\win32com\client\gencache.py", line 223, in GetModuleForCLSID
mod = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
File "G:\python32\lib\site-packages\win32com\client\gencache.py", line 259, in GetModuleForTypelib
mod = _GetModule(modName)
File "G:\python32\lib\site-packages\win32com\client\gencache.py", line 622, in _GetModule
mod = __import__(mod_name)
ValueError: source code string cannot contain null bytes

I can't seem to be able install PANDAS on CMD

First I got this message:
Defaulting to user installation because normal site-packages is not writeable.**
Then I got this error:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
yield
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\program files (x86)\python38-32\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "c:\program files (x86)\python38-32\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "c:\program files (x86)\python38-32\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "c:\program files (x86)\python38-32\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "c:\program files (x86)\python38-32\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\req_command.py", line 203, in wrapper
return func(self, options, args)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 315, in run
requirement_set = resolver.resolve(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\resolvelib\resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\resolvelib\structs.py", line 151, in __bool__
return bool(self._sequence)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 140, in __bool__
return any(self)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 128, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 32, in _iter_built
candidate = func()
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 204, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 295, in __init__
super().__init__(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 156, in __init__
self.dist = self._prepare()
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 227, in _prepare
dist = self._prepare_distribution()
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 305, in _prepare_distribution
return self._factory.preparer.prepare_linked_requirement(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\prepare.py", line 508, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\prepare.py", line 550, in _prepare_linked_requirement
local_file = unpack_url(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\prepare.py", line 239, in unpack_url
file = get_http_url(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\prepare.py", line 102, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\network\download.py", line 145, in __call__
for chunk in chunks:
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\progress_bars.py", line 144, in iter
for x in it:
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_internal\network\utils.py", line 63, in response_chunks
for chunk in response.raw.stream(
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\program files (x86)\python38-32\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\Marshal\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

simple apache beam pipeline throwing TypeError: an integer is required

I have this simple apache-beam pipeline written in python.
import apache_beam as beam
from apache_beam.runners.interactive.interactive_runner import InteractiveRunner
from apache_beam.runners.direct.direct_runner import DirectRunner
from apache_beam.options.pipeline_options import PipelineOptions
p = beam.Pipeline(InteractiveRunner(underlying_runner=DirectRunner()), options=PipelineOptions())
class Foo(beam.DoFn):
def process(self, element, *args, **kwargs):
k,v = element
yield (k , {k:v})
a = [('a',1), ('a',1), ('b',1)]
x0 = p | "0" >> beam.Create(a) | "2" >> beam.ParDo(Foo())
r = p.run()
r.wait_until_finish()
print(r.get(x0))
Running the above code throws the following error
Traceback (most recent call last):
File "apache_beam/runners/common.py", line 883, in apache_beam.runners.common.DoFnRunner.process
File "apache_beam/runners/common.py", line 497, in apache_beam.runners.common.SimpleInvoker.invoke_process
File "apache_beam/runners/common.py", line 1028, in apache_beam.runners.common._OutputProcessor.process_outputs
File "apache_beam/runners/worker/operations.py", line 177, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive
File "apache_beam/runners/worker/operations.py", line 155, in apache_beam.runners.worker.operations.ConsumerSet.update_counters_start
File "apache_beam/runners/worker/opcounters.py", line 214, in apache_beam.runners.worker.opcounters.OperationCounters.update_from
File "apache_beam/runners/worker/opcounters.py", line 233, in apache_beam.runners.worker.opcounters.OperationCounters.do_sample
File "apache_beam/coders/coder_impl.py", line 1162, in apache_beam.coders.coder_impl.WindowedValueCoderImpl.get_estimated_size_and_observables
File "apache_beam/coders/coder_impl.py", line 1172, in apache_beam.coders.coder_impl.WindowedValueCoderImpl.get_estimated_size_and_observables
File "apache_beam/coders/coder_impl.py", line 768, in apache_beam.coders.coder_impl.AbstractComponentCoderImpl.get_estimated_size_and_observables
File "apache_beam/coders/coder_impl.py", line 187, in apache_beam.coders.coder_impl.CoderImpl.get_estimated_size_and_observables
File "apache_beam/coders/coder_impl.py", line 686, in apache_beam.coders.coder_impl.VarIntCoderImpl.estimate_size
File "apache_beam/coders/stream.pyx", line 225, in apache_beam.coders.stream.get_varint_size
TypeError: an integer is required
However the same code works if we set a to list of lists instead of list of tuples.
a = [('a',1), ('a',1), ('b',1)] --> a = [['a',1], ['a',1], ['b',1]]
I have confirmed this is a bug. Filed https://issues.apache.org/jira/browse/BEAM-10833

Python client for AWS Redis Cluster

Can anyone suggest a Python client for AWS Redis Cluster enabled?
I'm using redis-py-cluster, but it fails:
Sample code:
from rediscluster import StrictRedisCluster
startup_nodes = [{"host": "xxxx.clustercfg.apn2.cache.amazonaws.com", "port": "6379"}]
r = StrictRedisCluster(startup_nodes=startup_nodes, decode_responses=True, skip_full_coverage_check=False)
r.set('foo', 'bar')
value = r.get('foo')
======
Exception:
Traceback (most recent call last):
File "testRedisCluster.py", line 11, in
r = StrictRedisCluster(startup_nodes=startup_nodes, decode_responses=True, skip_full_coverage_check=False)
File "/Library/Python/2.7/site-packages/rediscluster/client.py", line 181, in init
**kwargs
File "/Library/Python/2.7/site-packages/rediscluster/connection.py", line 141, in init
self.nodes.initialize()
File "/Library/Python/2.7/site-packages/rediscluster/nodemanager.py", line 228, in initialize
need_full_slots_coverage = self.cluster_require_full_coverage(nodes_cache)
File "/Library/Python/2.7/site-packages/rediscluster/nodemanager.py", line 270, in cluster_require_full_coverage
return any(node_require_full_coverage(node) for node in nodes.values())
File "/Library/Python/2.7/site-packages/rediscluster/nodemanager.py", line 270, in
return any(node_require_full_coverage(node) for node in nodes.values())
File "/Library/Python/2.7/site-packages/rediscluster/nodemanager.py", line 267, in node_require_full_coverage
return "yes" in r_node.config_get("cluster-require-full-coverage").values()
File "/Library/Python/2.7/site-packages/redis/client.py", line 715, in config_get
return self.execute_command('CONFIG GET', pattern)
File "/Library/Python/2.7/site-packages/redis/client.py", line 668, in execute_command
return self.parse_response(connection, command_name, **options)
File "/Library/Python/2.7/site-packages/redis/client.py", line 680, in parse_response
response = connection.read_response()
File "/Library/Python/2.7/site-packages/redis/connection.py", line 629, in read_response
raise response
redis.exceptions.ResponseError: unknown command 'CONFIG'
I'm using redis-py-cluster 1.3.4.
Any idea?
Change the parameter skip_full_coverage_check=False to skip_full_coverage_check=True

ValueError: invalid literal for int() with base 10: 'dev0'

I got this error while running my app in command line.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 280, in execute
translation.activate('en-us')
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 130, in activate
return _trans.activate(language)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 188, in activate
_active.value = translation(language)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", line 6, in <module>
from django.contrib.admin.sites import AdminSite, site
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py", line 4, in <module>
from django.contrib.admin.forms import AdminAuthenticationForm
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/forms.py", line 6, in <module>
from django.contrib.auth.forms import AuthenticationForm
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/forms.py", line 17, in <module>
from django.contrib.auth.models import User
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 48, in <module>
class Permission(models.Model):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 96, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 264, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/options.py", line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 199, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/base.py", line 11, in __init__
self.ops = PostGISOperations(self)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/operations.py", line 158, in __init__
if self.spatial_version < (1, 3, 4):
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/operations.py", line 252, in spatial_version
vtup = self.postgis_version_tuple()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/operations.py", line 426, in postgis_version_tuple
version = self.postgis_lib_version()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/operations.py", line 406, in postgis_lib_version
return self._get_postgis_func('postgis_lib_version')
File "/usr/local/lib/python2.7/dist-packages/django/contrib/gis/db/backends/postgis/operations.py", line 396, in _get_postgis_func
with self.connection.temporary_connection() as cursor:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 515, in temporary_connection
cursor = self.cursor()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 157, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 129, in _cursor
self.ensure_connection()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 124, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 115, in connect
self.set_autocommit(True)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 333, in set_autocommit
self._set_autocommit(autocommit)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 172, in _set_autocommit
if self.psycopg2_version >= (2, 4, 2):
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 49, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 201, in psycopg2_version
return tuple(int(v) for v in version.split('.'))
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 201, in <genexpr>
return tuple(int(v) for v in version.split('.'))
I installed the necessary modules. I am using Django version 1.6. The same app runs smoothly in my windows laptop but when I migrated it in a Linux OS, the errors shows.

Categories