Pweave resulting in MultipleInstanceError after updating anaconda - python

After updating to the current version of Anacondo (Anaconda3-5.0.0-Windows-x86_64), my pweave code has run into some issues.
When running for example
pweave.weave('example.texw', doctype = 'tex')
I get the MultipleInstanceError with the traceback shown below:
Traceback (most recent call last):
File "<ipython-input-9-85475eedd74e>", line 1, in <module>
pweave.weave('example.texw', doctype = 'tex')
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\pweave\__init__.py", line 59, in weave
doc.weave()
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site-
packages\pweave\pweb.py", line 192, in weave
self.run()
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\pweave\pweb.py", line 127, in run
self.wd
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\pweave\processors\jupyter.py", line 169, in __init__
super(IPythonProcessor, self).__init__(*args, embed_kernel=embed)
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\pweave\processors\jupyter.py", line 34, in __init__
km.start_kernel(cwd=path, stderr=open(os.devnull, 'w'))
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\ipykernel\inprocess\manager.py", line 46, in start_kernel
self.kernel = InProcessKernel(parent=self, session=self.session)
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\ipykernel\inprocess\ipkernel.py", line 72, in __init__
super(InProcessKernel, self).__init__(**traits)
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\ipykernel\ipkernel.py", line 46, in __init__
kernel = self,
File "C:\Users\tdecloedt\AppData\Local\Continuum\anaconda3\lib\site
packages\traitlets\config\configurable.py", line 423, in instance
'%s are being created.' % cls.__name__
MultipleInstanceError: Multiple incompatible subclass instances
InProcessInteractiveShell are being created.
I can however run pweave from the terminal as
pweave -f tex example.texw
I have not found relevant answers regarding the MultipleInstanceError elsewhere.
Any insight would be greatly appreciated!

Related

Spyder launch error: IndexError: List index out of range

I am new to python and currently using spyder 5.3.3 but I have encountered an issue where it will not launch. Please could you help with this.
Error message below
Traceback (most recent call last):
File "/Users/kira/opt/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/app/start.py", line 252, in main
mainwindow.main(options, args)
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 1956, in main
mainwindow = create_window(MainWindow, app, splash, options, args)
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/app/utils.py", line 289, in create_window
main.setup()
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 778, in setup
PLUGIN_REGISTRY.register_plugin(self, PluginClass,
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/api/plugin_registration/registry.py", line 342, in register_plugin
instance = self._instantiate_spyder5_plugin(
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/api/plugin_registration/registry.py", line 184, in _instantiate_spyder5_plugin
plugin_instance = PluginClass(main_window, configuration=CONF)
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/api/plugins/new_api.py", line 973, in __init__
super().__init__(parent, configuration=configuration)
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/api/plugins/new_api.py", line 313, in __init__
self._container = container = self.CONTAINER_CLASS(
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/console/widgets/main_widget.py", line 135, in __init__
self.shell = InternalShell( # TODO: Move to use SpyderWidgetMixin?
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/console/widgets/internalshell.py", line 153, in __init__
super().__init__(parent, get_conf_path('history_internal.py'),
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/console/widgets/shell.py", line 665, in __init__
ShellBaseWidget.__init__(self, parent, history_filename,
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/console/widgets/shell.py", line 75, in __init__
self.history = self.load_history()
File "/Users/kira/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/console/widgets/shell.py", line 503, in load_history
if rawhistory[1] != self.INITHISTORY[1]:
IndexError: list index out of range
#Kaza, I've just run over the same problem and after a few hours, I found this (History on spyder kills the kernel) that helped me out. In my case, a memory out of space corrupted the history.py file, which can be accessed through spyder defaults at the /Users/Name_User/.spyder-py3 (or under similar file name). Opening that file gave me the option to delete the history.py which resets the file and gets the spyder back to work.

How to resolve the Error in anaconda start up?

Few days ago, Anaconda Navigator used to work fine but now it won't open; I've even reinstalled the navigator but still getting the same issue.
Here is the error message
Navigator Error:
An unexpected error occurred on Navigator start-up
Main Error
unacceptable character #x0000: special characters are not allowed
in "C:\Users\home\.continuum\anaconda-client\config.yaml", position 0
Traceback
Traceback (most recent call last):
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\exceptions.py", line 72, in exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 146, in start_app
window = run_app(splash)
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 65, in run_app
window = MainWindow(splash=splash)
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 165, in __init__
self.api = AnacondaAPI()
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 1518, in AnacondaAPI
ANACONDA_API = _AnacondaAPI()
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 83, in __init__
self._client_api = ClientAPI(config=self.config)
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 659, in ClientAPI
CLIENT_API = _ClientAPI(config=config)
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 95, in __init__
self.reload_client()
File "C:\Users\home\anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 322, in reload_client
url = binstar_client.utils.get_config()['url']
File "C:\Users\home\anaconda3\lib\site-packages\binstar_client\utils\config.py", line 249, in get_config
file_configs = load_file_configs(SEARCH_PATH)
File "C:\Users\home\anaconda3\lib\site-packages\binstar_client\utils\config.py", line 241, in load_file_configs
raw_data = collections.OrderedDict(kv for kv in itertools.chain.from_iterable(load_paths))
File "C:\Users\home\anaconda3\lib\site-packages\binstar_client\utils\config.py", line 241, in
raw_data = collections.OrderedDict(kv for kv in itertools.chain.from_iterable(load_paths))
File "C:\Users\home\anaconda3\lib\site-packages\binstar_client\utils\config.py", line 221, in _dir_yaml_loader
yield filepath, load_config(filepath)
File "C:\Users\home\anaconda3\lib\site-packages\binstar_client\utils\config.py", line 205, in load_config
data = yaml_load(fd)
File "C:\Users\home\anaconda3\lib\site-packages\binstar_client\utils\yaml.py", line 12, in yaml_load
return safe_load(stream)
File "C:\Users\home\anaconda3\lib\site-packages\yaml\__init__.py", line 162, in safe_load
return load(stream, SafeLoader)
File "C:\Users\home\anaconda3\lib\site-packages\yaml\__init__.py", line 112, in load
loader = Loader(stream)
File "C:\Users\home\anaconda3\lib\site-packages\yaml\loader.py", line 34, in __init__
Reader.__init__(self, stream)
File "C:\Users\home\anaconda3\lib\site-packages\yaml\reader.py", line 85, in __init__
self.determine_encoding()
File "C:\Users\home\anaconda3\lib\site-packages\yaml\reader.py", line 135, in determine_encoding
self.update(1)
File "C:\Users\home\anaconda3\lib\site-packages\yaml\reader.py", line 169, in update
self.check_printable(data)
File "C:\Users\home\anaconda3\lib\site-packages\yaml\reader.py", line 143, in check_printable
raise ReaderError(self.name, position, ord(character),
yaml.reader.ReaderError: unacceptable character #x0000: special characters are not allowed
in "C:\Users\home\.continuum\anaconda-client\config.yaml", position 0
According to github the problem lies with "config.yaml" file in C:\Users\axith.continuum\anaconda-client\config.yaml , rename it to config.old or delete it

How to edit jupyter nbconvert templates

I'm currently trying to change the looks of the nbconvert-output in jupyter. To be more precise, I want to convert a ipynb to latex but not using the default tamplate. The thing is I don't know how to edit the files to get the result I want.
Lets say I want to use the "style_notebook.tplx" so I need to donwload ipython_nbconvert_config.py and use_cell_style.tplx. After that I need to change in the use_cell_style file the second line to ((* set cell_style = 'style_notebook.tplx' *)). But to be honest I don't know with what to edit a .tplx File (I used just Editor from Windows)....
After changing that and moving the two files to the same directonary as my .ipynb is, I tried this in the command prompt:
jupyter nbconvert --config ipython_nbconvert_config --to latex filename.ipynb
and got the error:
[NbConvertApp] WARNING | Error loading config file: ipython_nbconvert_config
Traceback (most recent call last):
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\jupyter_core\application.py", line 202, in load_config_file
path=path
File "<decorator-gen-5>", line 2, in load_config_file
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\config\application.py", line 603, in load_config_file
self.update_config(new_config)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\config\configurable.py", line 198, in update_config
self._load_config(config)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\config\configurable.py", line 168, in _load_config
warn(msg)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\contextlib.py", line 89, in __exit__
next(self.gen)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\traitlets.py", line 1131, in hold_trait_notifications
self.notify_change(change)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\traitlets.py", line 1176, in notify_change
c(change)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\nbconvert\nbconvertapp.py", line 227, in _postprocessor_class_changed
self.postprocessor_factory = import_item(new)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\utils\importstring.py", line 42, in import_item
return __import__(parts[0])
ModuleNotFoundError: No module named 'PDF'
Traceback (most recent call last):
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Sito\AppData\Local\Programs\Python\Python36-32\Scripts\jupyter-nbconvert.EXE\__main__.py", line 9, in <module>
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\jupyter_core\application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\nbconvert\nbconvertapp.py", line 252, in initialize
self.init_postprocessor()
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\nbconvert\nbconvertapp.py", line 298, in init_postprocessor
self._postprocessor_class_changed({'new': self.postprocessor_class})
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\nbconvert\nbconvertapp.py", line 227, in _postprocessor_class_changed
self.postprocessor_factory = import_item(new)
File "c:\users\Sito\appdata\local\programs\python\python36-32\lib\site-packages\traitlets\utils\importstring.py", line 42, in import_item
return __import__(parts[0])
ModuleNotFoundError: No module named 'PDF'
So it says that I miss the PDF-module, but I'm not sure hows that possible, because until now I could convert to pdf just fine. So I aussume I made some mistakes in changing the files...
Would be nice if someone could explain how to fix this problem..
Thanks, Sito.

dogpile.cache 'No module named fcntl' error

I'm using Python 2.7 with SQLAlchemy.
I'm trying to see if I can use Dogpile.Cache.
I've installed dogpile cache using
pip install dogpile.cache
but when I try to run the example given by SQLAlchemy (helloworld.py)
I keep getting ImportError: No module named fcntl. I thought the newest Dogpile.Cache resolved the windows issue...
Could someone please help?
Thank you.
UPDATE
Ok, the example is creating the database and cache. But when it is trying to load data using FromCache it is giving me an error.
people = Session.query(Person).options(FromCache("default")).all()
Here is the Traceback
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:\Users\JKIM\Downloads\DogpileCacheTest\examples\dogpile_caching\helloworld.py", line 13, in <module>
people = Session.query(Person).options(FromCache("default")).all()
File "build\bdist.win-amd64\egg\sqlalchemy\orm\query.py", line 2613, in all
File "examples\caching_query.py", line 63, in __iter__
return self.get_value(createfunc=lambda: list(Query.__iter__(self)))
File "examples\caching_query.py", line 108, in get_value
expiration_time=expiration_time
File "C:\Python27\lib\site-packages\dogpile\cache\region.py", line 657, in get_or_create
async_creator) as value:
File "C:\Python27\lib\site-packages\dogpile\lock.py", line 154, in __enter__
return self._enter()
File "C:\Python27\lib\site-packages\dogpile\lock.py", line 87, in _enter
value = value_fn()
File "C:\Python27\lib\site-packages\dogpile\cache\region.py", line 610, in get_value
value = self.backend.get(key)
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 220, in get
with self._dbm_file(False) as dbm:
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 212, in _dbm_file
with self._use_rw_lock(write):
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 207, in _use_rw_lock
with self._rw_lock.read():
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 327, in read
self.acquire_read_lock(True)
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 408, in acquire_read_lock
return self._acquire(wait, os.O_RDONLY, self._module.LOCK_SH)
File "C:\Python27\lib\site-packages\dogpile\util\langhelpers.py", line 63, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 400, in _module
import fcntl
ImportError: No module named fcntl

Launching nose with --with-gae option raises ValueError for missing lib/ipaddr

Setting up the testing framework and I can't seem to get past this error:
Traceback (most recent call last):
File "/usr/local/bin/nosetests", line 8, in <module>
load_entry_point('nose==1.1.2', 'console_scripts', 'nosetests')()
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/core.py", line 118, in __init__
**extra_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/core.py", line 135, in parseArgs
self.config.configure(argv, doc=self.usage())
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/config.py", line 338, in configure
self.plugins.configure(options, self)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/plugins/manager.py", line 271, in configure
cfg(options, config)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/plugins/manager.py", line 94, in __call__
return self.call(*arg, **kw)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/plugins/manager.py", line 162, in simple
result = meth(*arg, **kw)
File "build/bdist.macosx-10.7-intel/egg/nosegae.py", line 80, in configure
File "/usr/local/bin/dev_appserver.py", line 76, in <module>
DIR_PATH = get_dir_path(os.path.join('lib', 'ipaddr'))
File "/usr/local/bin/dev_appserver.py", line 66, in get_dir_path
'file and %s.' % sibling)
ValueError: Could not determine directory that contains both, this file and lib/ipaddr.
It's a correct error coming from dev_appserver.py... there is no lib/ipaddr in the /usr/local/bin directory.
Why is nosetests triggering the raising of this error? Why does dev_appengine try to look for lib/ipaddr in the first place?

Categories