I try to run behave tests in parallel. For this I use behave-parallel lib and demo project https://github.com/vishalm/behave_parallel_demo. But OS is Windows 10. After steps from Read_me file. I am getting next Tracebacks
(behave_parallel_demo-master) D:\Python_projects\behave_parallel_demo-master>behave --processes 5 --parallel-element feature
INFO: 0 scenario(s) and 3 feature(s) queued for consideration by 5 workers. Some may be skipped if the -t option was given...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\python27\Lib\multiprocessing\forking.py", line 381, in main
self = load(from_parent)
File "c:\python27\Lib\pickle.py", line 1384, in load
return Unpickler(file).load()
File "c:\python27\Lib\pickle.py", line 864, in load
dispatch[key](self)
File "c:\python27\Lib\pickle.py", line 1089, in load_newobj
obj = cls.__new__(cls, *args)
TypeError: __new__() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
File "c:\python27\Lib\runpy.py", line 174, 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:\Users\Andriy_Petrenko\Envs\behave_parallel_demo-master\Scripts\behave.exe\__main__.py", line 9, in <module>
File "c:\users\andriy_petrenko\envs\behave_parallel_demo-master\lib\site-packages\behave\__main__.py", line 111, in main
failed = runner.run()
File "c:\users\andriy_petrenko\envs\behave_parallel_demo-master\lib\site-packages\behave\runner.py", line 561, in run
return self.run_with_paths()
File "c:\users\andriy_petrenko\envs\behave_parallel_demo-master\lib\site-packages\behave\runner.py", line 583, in run_with_paths
return self.run_multiproc()
File "c:\users\andriy_petrenko\envs\behave_parallel_demo-master\lib\site-packages\behave\runner.py", line 690, in run_multiproc
p.start()
File "c:\python27\Lib\multiprocessing\process.py", line 130, in start
self._popen = Popen(self)
File "c:\python27\Lib\multiprocessing\forking.py", line 280, in __init__
to_child.close()
IOError: [Errno 22] Invalid argument
What I do wrong or is this OS problem? It looks like that 5 workers were up but 1st problem is that TypeError: __new__() takes exactly 3 arguments (2 given) and 2nd IOError: [Errno 22] Invalid argument
I am not familiar with Behave so not sure whether you are passing the command line correctly but this error means that one of the method is expecting more arguments than you have provided. In this case, it's during creation of cls instance:
File "c:\python27\Lib\pickle.py", line 1089, in load_newobj
obj = cls.__new__(cls, *args)
This looks like some internal class instance so you do not control it directly so make sure you pass enough and correct arguments at command line.
Update your Behave package. it will work.
We have been trying for a long time to implement parallel test executions with behave (which is an amazing framework). Finally, we created our own wrapper on top of Behave, called BehaveX, that not only allow us to execute tests in parallel, but also comes with great reports and some additional features:
https://github.com/hrcorval/behavex
As BehaveX is implemented over the Behave framework, with this wrapper you should be able to replace the "behave" executable by "behavex", and run the tests in parallel using the following commands:
behavex -t #TAG --parallel-processes 4 --parallel-scheme scenario
behavex -t #TAG --parallel-processes 3 --parallel-scheme feature
Related
I was hoping someone could help me understand why JupyterLab fails to spin up a kernel on my system.
Background
I'm working on macOS High Sierra. I used to have Anaconda installed via the Mac OS installer in the default location in my home folder ($HOME/anaconda). Based on this thread I uninstalled Anaconda.
I reinstalled Anaconda from the Homebrew Cask (placing export PATH=/usr/local/anaconda3/bin:"$PATH" in my .bashrc).
The Problem
Now when I
run jupyter-lab,
create a new notebook, and
select a Python 3 kernel,
the process fails with the following output:
Traceback (most recent call last):
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1543, in _execute
result = yield result
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
value = future.result()
File "/usr/local/anaconda3/lib/python3.6/site-packages/tornado/gen.py", line 315, in wrapper
yielded = next(result)
File "/usr/local/anaconda3/lib/python3.6/site-packages/notebook/services/kernels/kernelmanager.py", line 148, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/manager.py", line 259, in start_kernel
**kw)
File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/usr/local/anaconda3/lib/python3.6/site-packages/jupyter_client/launcher.py", line 128, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/usr/local/anaconda3/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/local/anaconda3/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '~/anaconda/bin/python': '~/anaconda/bin/python'
I'd already removed all references to $HOME/anaconda (my old install location) from my environment (.bashrc, .bash_profile), so I can't figure out where the reference is being picked up.
Any suggestions would be greatly appreciated.
This question was answered in this GitHub thread for the Jupyter project. The basic solution:
run jupyter kernelspec list to see if it points to the correct Python install
if not, remove the folder ~/Library/Jupyter
re-run jupyter kernelspec list
This should rebuild the directory and give output like
Available kernels:
python3 /usr/local/anaconda3/share/jupyter/kernels/python3
which is the proper location for the Homebrew install of Anaconda.
I use a lot of special characters from Hun language, and there were no problems previously. Now they all give errors when running the whole script (F9). It still runs perfect when running locally (select + F5).
FĂșĂș='bar'
Traceback:
C:\Users\my name\.ipython\cython\_cython_magic_21a3824690cdb52a9fe6a3fa1c63ee73.pyx:1:1: Unrecognized character
Traceback (most recent call last):
File "<ipython-input-6-dcfab52d0ff4>", line 1, in <module>
runfile('E:/Anyagok/Programozas/Python/projekts/elo/mindennap/untitled0.pyx', wdir='E:/Anyagok/Programozas/Python/projekts/elo/mindennap')
File "E:\Download\PROGIK\ANACONDA\lib\site-packages\spyder\utils\site\sitecustomize.py", line 703, in runfile
ipython_shell.run_cell_magic('cython', '', f.read())
File "E:\Download\PROGIK\ANACONDA\lib\site-packages\IPython\core\interactiveshell.py", line 2131, in run_cell_magic
result = fn(magic_arg_s, cell)
File "<decorator-gen-130>", line 2, in cython
File "E:\Download\PROGIK\ANACONDA\lib\site-packages\IPython\core\magic.py", line 187, in <lambda>
call = lambda f, *a, **k: f(*a, **k)
File "E:\Download\PROGIK\ANACONDA\lib\site-packages\Cython\Build\IpythonMagic.py", line 321, in cython
assert len(extensions) == 1
TypeError: object of type 'NoneType' has no len()
If I change to e.g.
Fuu='bar'
it works great. Why the sudden change of heart?
EDIT:
Have been messing around with FFMPEG and LIBAV yesterday, because wanted to download and convert Youtube videos to mp3. But I'm pretty sure I ran scripts with these characters succesfully after it.
When I open a Julia 0.6.0 notebook using Jupyter, the kernel tries to connect, fails and the a red button "Kernel Error" appears at the top right of the notebook. I uninstalled and reinstalled, but nothing has changed. The following is the message I got when I click on the "Kernel error":
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 516, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 75, in post
type=mtype))
File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 990, in _execute_child
startupinfo)
OSError: [WinError 740] The requested operation requires elevation.
Thanks in advance for your help!
It seem like you do not have enough permissions to start the Julia Kernel.
You should not need to be administrator to use the Julia kernel, but it seem like your computer is believing you should.
Try running the julia interpreter, and kernel manually to see if you can.
I am using addon-sdk for developing an extension.When I ran my code using cfx run on Firefox 32.0 and checked the browser console it shows following:
"DEPRECATED: The widget module is deprecated. Please consider using the sdk/ui module instead.
Traceback (most recent call last):
File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 114, in startup/<
run(options);
File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 170, in run
let program = main(options.loader, options.main);
File "resource://gre/modules/commonjs/toolkit/loader.js", line 645, in main
return loader.load(loader, module).exports;
File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
result = load(loader, module);
File "resource://gre/modules/commonjs/toolkit/loader.js", line 299, in load
evaluate(sandbox, module.uri);
File "resource://gre/modules/commonjs/toolkit/loader.js", line 262, in evaluate
: loadSubScript(uri, sandbox, encoding);
File "resource://skype_ff_extension-at-jetpack/skype_ff_extension/lib/main.js", line 14, in null
var widgets = require("sdk/widget");
File "resource://gre/modules/commonjs/toolkit/loader.js", line 619, in require
freeze(load(loader, module));
File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
result = load(loader, module);
File "resource://gre/modules/commonjs/toolkit/loader.js", line 299, in load
evaluate(sandbox, module.uri);
File "resource://gre/modules/commonjs/toolkit/loader.js", line 262, in evaluate
: loadSubScript(uri, sandbox, encoding);
File "resource://gre/modules/commonjs/sdk/widget.js", line 60, in null
"The widget module is deprecated. " +
File "resource://gre/modules/commonjs/sdk/util/deprecate.js", line 18, in deprecateUsage
let stack = get().slice(2);"
How to debug this error?
PS:To anyone who see this error first check if its your add-on or any other add-on which is throwing this error.
open about:support
then search there Skype Click to Call plugin ID
and remove file with name
{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
from your
mozilla_installation_path\browser\extensions\
(c:\Program Files (x86)\Mozilla Firefox\browser\extensions\)
Solution is to edit code in the add-on. Take out that require('widget') and move to require('sdk/ui'): https://blog.mozilla.org/addons/2014/03/13/new-add-on-sdk-australis-ui-features-in-firefox-29/
Once you change to sdk/ui, you have to change how the add-on was making widgets to use the sdk/ui. Lean about that by:
See and follow the links in the note "Deprecated" seen on the documentation page of widget module: https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/widget
Try removing extensions.sdk.console.logLevel; all from about:config and replacing it with extensions.YOUR_EXTENSION_ID.sdk.console.logLevel; all
This should return the log level to the default of error, meaning you won't see any other extensions' console.log output.
Edit
The above still shows other extensions' error messages, if you want to remove them, do the following.
Check out this post for an explanation. Essentially, you add a string to about:config (by right-clicking) called extensions.sdk.console.logLevel and set it to off, then add the string extensions.YOUR_EXTENSION_ID.sdk.console.logLevel and set it to all.
I am trying desperately to get ipython notebook to work in a windows environment. I installed Continuum IO's Anaconda, a scientific distribution of python. I want to use ipython notebook, but get the following error. ipython in the terminal works fine. Any thoughts?
UPDATE: As asked for below, here is the output from sys.path on my system.
['',
'C:\\Anaconda\\scripts',
'C:\\Anaconda\\lib\\site-packages\\distribute-0.6.45-py2.7.egg',
'C:\\Anaconda',
'C:\\Users\\btibert\\ C:\\Anaconda\\Scripts',
'C:\\Anaconda\\python27.zip',
'C:\\Anaconda\\DLLs',
'C:\\Anaconda\\lib',
'C:\\Anaconda\\lib\\plat-win',
'C:\\Anaconda\\lib\\lib-tk',
'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages',
'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages\\Orange\\orng',
'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages\\setuptools-0.6c11-py2.7.egg-info',
'C:\\Anaconda\\lib\\site-packages',
'C:\\Anaconda\\lib\\site-packages\\PIL',
'C:\\Anaconda\\lib\\site-packages\\win32',
'C:\\Anaconda\\lib\\site-packages\\win32\\lib',
'C:\\Anaconda\\lib\\site-packages\\Pythonwin',
'C:\\Users\\btibert\\AppData\\Roaming\\Python\\Python27\\site-packages\\IPython\\extensions']
And here is the error:
C:\Users\btibert>ipython notebook
Traceback (most recent call last):
File "C:\Anaconda\Scripts\ipython-script.py", line 5, in <module>
sys.exit(launch_new_instance())
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\terminal\ipapp.py", line 402, in
launch_new_instance
app.initialize()
File "<string>", line 2, in initialize
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
return method(app, *args, **kwargs)
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\terminal\ipapp.py", line 302, in
initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
return method(app, *args, **kwargs)
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\core\application.py", line 325, in initia
lize
self.parse_command_line(argv)
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\terminal\ipapp.py", line 297, in
parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
return method(app, *args, **kwargs)
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 413, in pars
e_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 84, in catch
_config_error
return method(app, *args, **kwargs)
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\config\application.py", line 349, in init
ialize_subcommand
subapp = import_item(subapp)
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\utils\importstring.py", line 40, in impor
t_item
module = __import__(package,fromlist=[obj])
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\IPython\frontend\html\notebook\notebookapp.py", l
ine 34, in <module>
from zmq.eventloop import ioloop
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\zmq\eventloop\__init__.py", line 3, in <module>
from zmq.eventloop.ioloop import IOLoop
File "C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\zmq\eventloop\ioloop.py", line 56, in <module>
from zmq.eventloop.platform.auto import set_close_exec, Waker
ImportError: No module named platform.auto
It would be helpful to know what your sys.path is. You can find that by doing:
$ ipython
In [1]: import sys
In [2]: sys.path
And then share here the output. Next, you want to check what files you have in this directory:
C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages\zmq\eventloop\platform
Ideally, you'll see auto.py there, and if C:\Users\btibert\AppData\Roaming\Python\Python27\site-packages is in your sys.path then it is a mystery why it isn't working, but if that file isn't there, the directory doesn't exist, or the path to site-packages isn't in your sys.path, then those need to be resolved first.
Let us know and we can try to take it from there!
I figured out one way to attack this. I didn't really think I would have to get this level, but I completely uninstalled every single possible instance of python I could find. I
unisntalled Anaconda CE
removed every reference to python in PATH
edited my registry to clear out python data (but did leave Python folders)
Removed python from the App/Roaming path outlined above by #IanSR
Basically, I removed every possible reference to python I could find and then re-installed Anaconda CE. Voila, the Anaconda install (appears) to have worked as intended by the distributors.