PyDEM LoweringError: slc0.8 - python

I'm in Win7 64, Anaconda Python installation, pip installed PyDEM.
I'm getting an error when calling .calc_slopes_directions() on a DEMProcessor instance (see below).
I'm aware of this question; that seems not to be the same problem I have.
This LoweringError: slc0.8 seems to be related to Numba.
This is the code I enter and the error I get:
from pydem.dem_processing import DEMProcessor
os.chdir(r'D:\my_path')
a_tile = r'31an2_clipped_wgs84.tif'
dem_proc = DEMProcessor(a_tile)
mag, aspect = dem_proc.calc_slopes_directions()
starting slope/direction calculation for chunk 1 [0:516, 0:516]
Traceback (most recent call last):
File "<ipython-input-13-6dc0db5771d2>", line 1, in <module>
mag, aspect = dem_proc.calc_slopes_directions()
File "C:\Program Files\Anaconda2\lib\site-packages\pydem\dem_processing.py", line 853, in calc_slopes_directions
self.dY[te:be-1])
File "C:\Program Files\Anaconda2\lib\site-packages\pydem\dem_processing.py", line 879, in _slopes_directions
return self._tarboton_slopes_directions(data, dX, dY)
File "C:\Program Files\Anaconda2\lib\site-packages\pydem\dem_processing.py", line 890, in _tarboton_slopes_directions
self.facets, self.ang_adj)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\dispatcher.py", line 285, in _compile_for_args
return self.compile(tuple(argtypes))
File "C:\Program Files\Anaconda2\lib\site-packages\numba\dispatcher.py", line 531, in compile
cres = self._compiler.compile(args, return_type)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\dispatcher.py", line 80, in compile
flags=flags, locals=self.locals)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 725, in compile_extra
return pipeline.compile_extra(func)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 369, in compile_extra
return self.compile_bytecode(bc, func_attr=self.func_attr)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 378, in compile_bytecode
return self._compile_bytecode()
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 690, in _compile_bytecode
return self._compile_core()
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 677, in _compile_core
res = pm.run(self.status)
File "C:\Program Files\Anaconda2\lib\site-packages\numba\compiler.py", line 257, in run
raise patched_exception
LoweringError: slc0.8

Related

trying to run aws lambda locally with a layer for pandas using cdk - not working

I'm using the AWS CDK to run lambda functions locally. I have followed a couple of tutorials on setting this up but I appear to be getting issues when invoking the function with SAM. The typical error I encounter is below:
Invoking handler.handle (python3.9)
PypassLambdaLayer0643FC6D is a local Layer in the template
Image was not found.
Building image...Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\__main__.py", line 12, in <module>
cli(prog_name="sam")
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py", line 166, in wrapped
raise exception # pylint: disable=raising-bad-type
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py", line 124, in wrapped
return_value = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\version_checker.py", line 41, in wrapped
actual_result = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\cli\main.py", line 87, in wrapper
return func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\local\invoke\cli.py", line 85, in cli
do_cli(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\local\invoke\cli.py", line 182, in do_cli
context.local_lambda_runner.invoke(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\local\lib\local_lambda.py", line 137, in invoke
self.local_runtime.invoke(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py", line 230, in wrapped_func
return_value = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\lambdafn\runtime.py", line 177, in invoke
container = self.create(function_config, debug_context, container_host, container_host_interface)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\lambdafn\runtime.py", line 73, in create
container = LambdaContainer(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\docker\lambda_container.py", line 93, in __init__
image = LambdaContainer._get_image(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\docker\lambda_container.py", line 236, in _get_image
return lambda_image.build(runtime, packagetype, image, layers, architecture, function_name=function_name)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\docker\lambda_image.py", line 163, in build
self._build_image(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\docker\lambda_image.py", line 261, in _build_image
with create_tarball(tar_paths, tar_filter=tar_filter) as tarballfile:
File "contextlib.py", line 113, in __enter__
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\tar.py", line 29, in create_tarball archive.add(path_on_system, arcname=path_in_tarball, filter=tar_filter)
File "tarfile.py", line 1977, in add
File "tarfile.py", line 1977, in add
File "tarfile.py", line 1977, in add
[Previous line repeated 1 more time]
File "tarfile.py", line 1955, in add
File "tarfile.py", line 1834, in gettarinfo
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\LeeBarrett\\OneDrive - LumiraDx Group Ltd\\Documents\\pypass_dev\\2022\\pypass_connect_lambda\\cdk.out\\asset.60e64357ce064cf62274b8d1a8976ceb2903f31abd576090b450010d30b4ac7a\\python\\numpy\\.libs\\libopenblas.FB5AE2TYXYH2IJRDKGDGQ3XBKLKTF43H.gfortran-win_amd64.dll'
I've had multiple errors similar to that above but sometimes the file that is (apparently) missing is different. It looks like an issue with building the image rather than the stack code itself but I'm unsure and couldn't find any other similar issues.
The code I am using in the Stack class object is below:
pypass_lambda_layer = _lambda.LayerVersion(self, "PypassLambdaLayer", code=_lambda.Code.from_asset("lambda/layers"), compatible_runtimes=[_lambda.Runtime.PYTHON_3_9])
my_lambda = _lambda.Function(self, "Pypasshandler", runtime=_lambda.Runtime.PYTHON_3_9, code=_lambda.Code.from_asset("lambda/code"), handler="handler.handle", layers=[pypass_lambda_layer])
Tutorials I tried to follow:
https://dev.to/upupkenchoong/how-to-provision-lambda-and-lambda-layer-with-cdk-2ff4
https://medium.com/geekculture/deploying-aws-lambda-layers-with-python-8b15e24bdad2
The layers folder referenced in the LayerVersion function contains another folder called python which has pandas installed in it.
\lambda
\layers
\python
\code
handler.py
I'm on a windows machine and I have the cdk packages installed in conda virtual environment.
Any help would be greatly appreciated.
Thanks

How do I resolve the kernel error in my Jupyter Notebook?

I installed jupyter notebook with pip but everytime I create a new notebook, it shows a kernel error-
Traceback (most recent call last):
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\web.py", line 1704, in _execute
result = await result
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\notebook\services\sessions\sessionmanager.py", line 98, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\notebook\services\sessions\sessionmanager.py", line 111, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\notebook\services\kernels\kernelmanager.py", line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\utils.py", line 21, in wrapped
return loop.run_until_complete(coro(*args, **kwargs))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\nest_asyncio.py", line 70, in run_until_complete
return f.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\asyncio\futures.py", line 181, in result
raise self._exception
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\asyncio\tasks.py", line 249, in __step
result = coro.send(None)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\multikernelmanager.py", line 186, in _async_start_kernel
self._add_kernel_when_ready(kernel_id, km, ensure_async(km.start_kernel(**kwargs)))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\utils.py", line 21, in wrapped
return loop.run_until_complete(coro(*args, **kwargs))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\nest_asyncio.py", line 70, in run_until_complete
return f.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\asyncio\futures.py", line 181, in result
raise self._exception
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\asyncio\tasks.py", line 249, in __step
result = coro.send(None)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\manager.py", line 331, in _async_start_kernel
kernel_cmd, kw = await ensure_async(self.pre_start_kernel(**kw))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\utils.py", line 21, in wrapped
return loop.run_until_complete(coro(*args, **kwargs))
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\nest_asyncio.py", line 70, in run_until_complete
return f.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\asyncio\futures.py", line 181, in result
raise self._exception
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\asyncio\tasks.py", line 249, in __step
result = coro.send(None)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\manager.py", line 298, in _async_pre_start_kernel
kw = await self.provisioner.pre_launch(**kw)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\provisioning\local_provisioner.py", line 165, in pre_launch
km.write_connection_file()
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\connect.py", line 527, in write_connection_file
kernel_name=self.kernel_name,
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_client\connect.py", line 164, in write_connection_file
with secure_write(fname) as f:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_core\paths.py", line 461, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\tanis\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: The specified module could not be found.
This is the error that shows up everytime. I tried reinstalling jupyter as well but nothing worked. Is there a way I can use jupyter without having to install anaconda?

tuple index out of range (sqlfluff)

I am using python 3.9.1 and have 0.3.6 sqlfluff. I do lint some files successfully and fix them however I am trying to lint 757 rows of sql file and it is giving me this error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/sqlfluff", line 8, in <module>
sys.exit(cli())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/cli/commands.py", line 172, in lint
result = lnt.lint_paths(paths, verbosity=verbose, ignore_non_existent_files=False)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/linter.py", line 911, in lint_paths
result.add(self.lint_path(path, verbosity=verbosity, fix=fix,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/linter.py", line 896, in lint_path
self.lint_string(target_file.read(), fname=fname,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/linter.py", line 748, in lint_string
lerrs, _, _, _ = crawler.crawl(parsed, dialect=config.get('dialect_obj'))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/rules/base.py", line 268, in crawl
dvs, raw_stack, child_fixes, memory = self.crawl(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/rules/base.py", line 233, in crawl
res = self._eval(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sqlfluff/rules/std.py", line 53, in _eval
if raw_stack[idx].type == 'whitespace':
IndexError: tuple index out of range
github issue

Theano error while fitting a PyMC3 model in parallel - No module named 'tmpttugnbtl'

I'm fitting an identical PyMC3 model to different datasets in parallel using joblib and the multiprocessing module and I'm running into a strange error.
Although the model fits fine for the vast majority of the datasets, it fails for a random subset, here's the error message:
Traceback (most recent call last):
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py", line 418, in _process_worker
r = call_item()
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py", line 272, in __call__
return self.fn(*self.args, **self.kwargs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 567, in __call__
return self.func(*args, **kwargs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in __call__
for func, args, kwargs in self.items]
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in <listcomp>
for func, args, kwargs in self.items]
File "fit_ogle3_2002.py", line 80, in fit_event
pspl_model, alert_time = initialize_model(event)
File "/gpfs1/home/fb90/hierarchical/fit_albrow/model.py", line 88, in initialize_model
mean = f*F_base*mag + (1 - f)*F_base
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/tensor/var.py", line 155, in __mul__
return theano.tensor.mul(self, other)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 670, in __call__
no_recycling=[])
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 955, in make_thunk
no_recycling)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/op.py", line 858, in make_c_thunk
output_storage=node_output_storage)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1217, in make_thunk
keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1157, in __compile__
keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cc.py", line 1624, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 1148, in module_from_key
module = self._get_from_key(key)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 1047, in _get_from_key
return self._get_module(name)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 720, in _get_module
self.module_from_name[name] = dlimport(name)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/theano/gof/cmodule.py", line 317, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ModuleNotFoundError: No module named 'tmpttugnbtl'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "fit_ogle3_2002.py", line 153, in <module>
result = Parallel(n_jobs)(delayed(fit_event)(directory) for directory in dirs)
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 934, in __call__
self.retrieve()
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 833, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/home/fb90/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 521, in wrap_future_result
return future.result(timeout=timeout)
File "/home/fb90/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/home/fb90/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
ModuleNotFoundError: No module named 'tmpttugnbtl'
What exactly is No module named 'tmpttugnbtl' supposed to mean :S?
I'm using version 3.7 of PyMC3 and version 1.0.4 of Theano. The code is paralellized using the following lines
from joblib import Parallel, delayed
import multiprocessing
n_jobs = 32
result = Parallel(n_jobs)(delayed(fit_event)(directory) for directory in dirs)

Using pip install within PyScripter

I want to install a Python package within a script in PyScripter.
import pip
package = 'xlsxwriter'
pip.main(['install', package])
Following error occurs:
Collecting xlsxwriter
Downloading XlsxWriter-0.9.3-py2.py3-none-any.whl (136kB)
Exception:
Traceback (most recent call last):
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\commands\install.py", line 299, in run
requirement_set.prepare_files(finder)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\req\req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\req\req_set.py", line 587, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\download.py", line 810, in unpack_url
hashes=hashes
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\download.py", line 649, in unpack_http_url
hashes)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\download.py", line 871, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\download.py", line 577, in _download_url
progress_indicator = DownloadProgressBar(max=total_length).iter
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\utils\ui.py", line 158, in __init__
super(WindowsMixin, self).__init__(*args, **kwargs)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\utils\ui.py", line 82, in __init__
super(InterruptibleMixin, self).__init__(*args, **kwargs)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\utils\ui.py", line 118, in __init__
super(DownloadProgressMixin, self).__init__(*args, **kwargs)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip\_vendor\progress\helpers.py", line 58, in __init__
if self.file.isatty() and self.hide_cursor:
File "<string>", line 523, in __getattr__
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 150, in __getattr__
return syncreq(self, consts.HANDLE_GETATTR, name)
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 434, in sync_request
raise obj
AttributeError: DebugOutput instance has no attribute 'isatty'
Why does this error occur und how to fix it? The same code works well when using the Python interpreter directly, but not with PyScripter for some reason.
Thanks a lot for your help.

Categories