Questions tagged [python-traitlets]

9 questions
9
votes
4 answers

ipykernel (Jupyter notebook/labs) cannot import name ''filefind" from traitlets.utils

I installed Jupyter notebook and labs on and EC2 instance and for some reason I get the following error: ImportError: cannot import name 'filefind' from 'traitlets.utils' (/usr/lib/python3/dist-packages/traitlets/utils/init.py) Jupyter opens fine…
Rick Vink
  • 321
  • 1
  • 3
  • 11
2
votes
2 answers

AttributeError: module 'IPython.utils.traitlets' has no attribute 'Unicode'

I am running a .ipynb notebook on a Kaggle server. At the first code cell, when importing modules, specifically cv2_imshow from google.patches as follows, from google.colab.patches import cv2_imshow I get this…
1
vote
1 answer

How do you embed an ipython console with exec_lines?

I'm trying to embed an ipython console into my command line application. I have the following: import IPython from traitlets.config import Config c = Config() c.InteractiveShellApp.exec_lines = [ 'import matplotlib.pyplot as plt', …
Lucidnonsense
  • 1,195
  • 3
  • 13
  • 35
1
vote
1 answer

Failed to start the Kernel. Cannot run Jupyter Notebook in VS Code for Windows. Issue with Traitlets

I am trying to run a Jupyter Notebook in VS Code for Windows and running into an issue with traitlets. Can anyone help? Following steps to re-create: Start new Python virtual environment. Create new Jupyter Notebook (.ipynb file) Open file in VS…
1
vote
0 answers

How to covert Javascript DataView object back to python bytes type?

In one of my projects, I'm passing a serialized python instance as bytes type to the Javascript front end. At the javascript side When I console.log the this.model.get('MyInstance') it returns MyInstance as a data view object. Now I want to pass…
jax
  • 3,927
  • 7
  • 41
  • 70
1
vote
0 answers

How to change traitlets Dict to a normal python dictionary type?

How to convert traitlets Dict type to normal python dictionary type. I have an example code as given below when I am trying to access the keys and values of form_output as a standard python dictionary it shows an error. form_output =…
jax
  • 3,927
  • 7
  • 41
  • 70
0
votes
0 answers

Failure on evaluating the nodes in PODPAC library

I have been following the example notebook for PODPAC library. However, the simplest node.eval(coord) fails. The other thing I have tried is downloading the tif file from s3 into local machine and then trying to run node.eval(node.coordinates) based…
0
votes
0 answers

is it possible to capture stdout using a traitlets Unciode?

I'm using the ipyvuetify lib to display dashboards in a Jupyter+voila environment. In my last app, I make a call to a method that print information about computation in stdout and I would like to redirect it to a Unicode trait (which is then used in…
Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
0
votes
1 answer

is it possible to iterate a Tuple traitlets?

I transformed some of my lib variable into traitlets and I'm facing an error when iterating on a Tuple even though this is possible with built-in tuple. from traitlets import Tuple a = Tuple((1,2,4)).tag(sync=True) for i in a: print(i) >>>…
Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47