Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.x: Typerror following the medium post examples #10

Open
jabyrd3 opened this issue Oct 22, 2017 · 1 comment
Open

Python 3.x: Typerror following the medium post examples #10

jabyrd3 opened this issue Oct 22, 2017 · 1 comment

Comments

@jabyrd3
Copy link

jabyrd3 commented Oct 22, 2017

!pip install pixiedust
!pip install pixiedust_node
import pixiedust_node
%%node
var date = new Date();
print(date);
TypeError                                 Traceback (most recent call last)
<ipython-input-4-26ef6f3fb6e5> in <module>()
----> 1 get_ipython().run_cell_magic('node', '', 'var date = new Date();\nprint(date);')

/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
   2129             magic_arg_s = self.var_expand(line, stack_depth)
   2130             with self.builtin_trap:
-> 2131                 result = fn(magic_arg_s, cell)
   2132             return result
   2133 

<decorator-gen-126> in node(self, line, cell)

/opt/conda/lib/python3.6/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--> 187         call = lambda f, *a, **k: f(*a, **k)
    188 
    189         if callable(arg):

/opt/conda/lib/python3.6/site-packages/pixiedust_node/__init__.py in node(self, line, cell)
     48     def node(self, line, cell):
     49         # write the cell contents to the Node.js process
---> 50         self.n.write(cell)
     51 
     52 try:

/opt/conda/lib/python3.6/site-packages/pixiedust_node/node.py in write(self, s)
     53 
     54     def write(self, s):
---> 55         self.ps.stdin.write(s)
     56         self.ps.stdin.write("\r\n")
     57 

TypeError: a bytes-like object is required, not 'str'

Any ideas?

@DTAIEB
Copy link
Member

DTAIEB commented Oct 23, 2017

This is a known issue, pixiedust_node doesn't currently work with Python 3.x. Workaround is to use Python 2.7 until we provide a fix for 3.x

@glynnbird glynnbird added this to the Python3 milestone Jan 3, 2018
@ptitzler ptitzler changed the title Typerror following the medium post examples Python 3.x: Typerror following the medium post examples Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants