ivanov / bipython Goto Github PK
View Code? Open in Web Editor NEWThe indiscriminate bicurious interactive python interpreter (bpython + ipython)
License: BSD 3-Clause "New" or "Revised" License
The indiscriminate bicurious interactive python interpreter (bpython + ipython)
License: BSD 3-Clause "New" or "Revised" License
due to recent API and messaging spec changes, bipython only works on ipython version <= 2.1
Can't input unicode text. Try to type é
, get é
. This is what would happen if utf8 bytes were interpreted as latin1:
In [2]: print u'é'.encode('utf8').decode('latin1')
é
$> touch uñîçø∂é
$> bipython
in bipython:
In [1]: u<TAB>
crashes with
UnicodeEncodeError: 'ascii' codec can't encode character...
deep inside urwid. Looks like a str _caption
and unicode text
.
After installing all the components, when typing bipython
into the terminal I get:
Traceback (most recent call last):
File "/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/usr/lib/python2.7/site-packages/bipython/__init__.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/usr/lib/python2.7/site-packages/bipython/__init__.py", line 651, in __init__
self.ipython = self.connect_ipython_kernel()
File "/usr/lib/python2.7/site-packages/bipython/__init__.py", line 708, in connect_ipython_kernel
self.echod(":IPython " + s + " failed", "Info")
TypeError: echod() takes exactly 2 arguments (3 given)
any idea?
When I import bipython after installing it, I get
In [1]: from bipython import main
fatal: Not a git repository (or any of the parent directories): .git
You may want to use something more sophisticated, like https://github.com/warner/python-versioneer.
after doing a
pip install bipython
on startup it spits out the following error :
/home/aftnix/.local/lib/python2.7/site-packages/IPython/config.py:13: ShimWarning: The `IPython.config` package has been deprecated. You should import from traitlets.config instead.
"You should import from traitlets.config instead.", ShimWarning)
/home/aftnix/.local/lib/python2.7/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
"You should import from ipykernel or jupyter_client instead.", ShimWarning)
Traceback (most recent call last):
File "/usr/local/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/usr/local/lib/python2.7/dist-packages/bipython/__init__.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/usr/local/lib/python2.7/dist-packages/bipython/__init__.py", line 651, in __init__
self.ipython = self.connect_ipython_kernel()
File "/usr/local/lib/python2.7/dist-packages/bipython/__init__.py", line 681, in connect_ipython_kernel
from IPython.zmq.blockingkernelmanager import BlockingKernelManager as KernelManager
ImportError: No module named zmq.blockingkernelmanager
While starting bipython getting the below error.
Traceback (most recent call last):
File "/Users/mrokade/.virtualenvs/cricket/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/Users/mrokade/.virtualenvs/cricket/lib/python2.7/site-packages/bipython/__init__.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/Users/mrokade/.virtualenvs/cricket/lib/python2.7/site-packages/bipython/__init__.py", line 651, in __init__
self.ipython = self.connect_ipython_kernel()
File "/Users/mrokade/.virtualenvs/cricket/lib/python2.7/site-packages/bipython/__init__.py", line 712, in connect_ipython_kernel
km.load_connection_file()
File "/Users/mrokade/.virtualenvs/cricket/lib/python2.7/site-packages/IPython/kernel/connect.py", line 504, in load_connection_file
cfg = json.load(f)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Any ideas how this can be fixed ?
Perhaps I'm being really dense, but is there a way to choose which ipython kernel to connect to? I am really loving this interface as a way to conduct quick explorations while I've got a notebook open, and then copy my results back into the notebook after I've used the interactive features to figure out how to do something. However, if I've got more than one notebook open, there are several kernels, and I'm not sure how to tell bipython which to connect to.
Perhaps a dialog, on launch, to select which kernel to use would be useful, or an ipython magic function to launch bipython connected to the current kernel, or an implementation of the --existing flag?
I realize that this project is reasonably early in development, without a big team, but I absolutely love it, and hope it takes off in a big way! Great work.
After running bipython
after running ipython console
or ipython kernel
I get
> bipython
fatal: Not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "/Users/scott/anaconda/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.3.-f261b78-', 'console_scripts', 'bipython')()
File "/Users/scott/anaconda/lib/python2.7/site-packages/bipython-0.1.3._f261b78_-py2.7.egg/bipython/__init__.py", line 1860, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/Users/scott/anaconda/lib/python2.7/site-packages/bipython-0.1.3._f261b78_-py2.7.egg/bipython/__init__.py", line 728, in __init__
self.ipython = self.connect_ipython_kernel()
File "/Users/scott/anaconda/lib/python2.7/site-packages/bipython-0.1.3._f261b78_-py2.7.egg/bipython/__init__.py", line 817, in connect_ipython_kernel
self.send_ipython = kc.shell_channel.execute
AttributeError: 'ZMQSocketChannel' object has no attribute 'execute'
I'd really like to use bipython.
Hey,
talked earlier today at pycon. Here is an issue, as promised. Ima take a look at the bpython code and see whats up.
What I did:
sudo pip install bipython
ipython console &
bipython
This is the traceback:
Traceback (most recent call last):
File "/usr/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3.4/site-packages/bipython/__init__.py", line 161
print sys.exc_info()
^
SyntaxError: invalid syntax
EDIT: I saw that you don't support Python 3 yet. However running it under python 2 yielded a different error.
sudo pip2 install bipython
ipython2 console &
bipython
Traceback (most recent call last):
File "/usr/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/usr/lib/python2.7/site-packages/bipython/__init__.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/usr/lib/python2.7/site-packages/bipython/__init__.py", line 651, in __init__
self.ipython = self.connect_ipython_kernel()
File "/usr/lib/python2.7/site-packages/bipython/__init__.py", line 738, in connect_ipython_kernel
self.send_ipython = kc.shell_channel.execute
AttributeError: 'ZMQSocketChannel' object has no attribute 'execute'
When i try to run on a virtualenv i got this error:
Traceback (most recent call last):
File "/home/cassiobotaro/.virtualenvs/engenharia/bin/bipython", line 9, in
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/home/cassiobotaro/.virtualenvs/engenharia/local/lib/python2.7/site-packages/bipython/init.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/home/cassiobotaro/.virtualenvs/engenharia/local/lib/python2.7/site-packages/bipython/init.py", line 651, in init
self.ipython = self.connect_ipython_kernel()
File "/home/cassiobotaro/.virtualenvs/engenharia/local/lib/python2.7/site-packages/bipython/init.py", line 708, in connect_ipython_kernel
self.echod(":IPython " + s + " failed", "Info")
TypeError: echod() takes exactly 2 arguments (3 given)
setup.py
claims >= 0.12
, but it does not appear to work with 1.2.1 or 1.1.0:
[~]$ ipython
Python 2.7.3 | 64-bit | (default, Aug 8 2013, 05:37:06)
Type "copyright", "credits" or "license" for more information.
IPython 1.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
[~]
|1>
Do you really want to exit ([y]/n)?
[~]$ bipython
Traceback (most recent call last):
File "/Users/rkern/Library/Enthought/Canopy_64bit/User/bin/bipython", line 10, in <module>
sys.exit(main())
File "/Users/rkern/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bipython/__init__.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/Users/rkern/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bipython/__init__.py", line 651, in __init__
self.ipython = self.connect_ipython_kernel()
File "/Users/rkern/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/bipython/__init__.py", line 712, in connect_ipython_kernel
km.load_connection_file()
File "/Users/rkern/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/kernel/connect.py", line 495, in load_connection_file
setattr(self, name, cfg[name])
KeyError: 'control_port'
Traceback (most recent call last):
File "/usr/local/bin/bipython", line 9, in
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bipython/init.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bipython/init.py", line 651, in init
self.ipython = self.connect_ipython_kernel()
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bipython/init.py", line 706, in connect_ipython_kernel
fullpath = find_connection_file(s.lstrip().rstrip())
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/kernel/connect.py", line 212, in find_connection_file
profile_dir = ProfileDir.find_profile_dir_by_name(get_ipython_dir(), 'default')
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/profiledir.py", line 264, in find_profile_dir_by_name
raise ProfileDirError('Profile directory not found in paths: %s' % dirname)
IPython.core.profiledir.ProfileDirError: Profile directory not found in paths: profile_default
$ sudo pip2.7 install --upgrade bipython
Downloading/unpacking bipython
Could not find any downloads that satisfy the requirement bipython
[…]
$ sudo pip3.3 install --upgrade bipython
Downloading/unpacking bipython
Could not find any downloads that satisfy the requirement bipython
[…]
bipython
installs fine on Python 3.3 here, however:
$ bipython
Traceback (most recent call last):
File "/usr/local/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/usr/local/lib/python3.3/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.3/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.3/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python3.3/dist-packages/bipython/__init__.py", line 161
print sys.exc_info()
^
SyntaxError: invalid syntax
Is bipython
meant to be Python 3 compatible?
Traceback (most recent call last):
File "/home/fjc/.pyenv/versions/3.5.0/bin/bipython", line 9, in
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/home/fjc/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/init.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/fjc/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/init.py", line 2697, in load_entry_point
return ep.load()
File "/home/fjc/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/init.py", line 2370, in load
return self.resolve()
File "/home/fjc/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/init.py", line 2376, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/fjc/.pyenv/versions/3.5.0/lib/python3.5/site-packages/bipython/init.py", line 161
print sys.exc_info()
^
SyntaxError: invalid syntax
This is what I have in ipython:
. And this is bipython:
. I guess it is easy to see the difference:
. I have checked out bipython code, but did not find any standard way to configure prompt. Worse, I have not found standard way to use different colors inside the prompt, so I cannot hack it like I did with old ipython (if you check out powerline code you will see that I had to add three classes with custom __str__
of which one is proxy class with custom __add__
just to forbid old ipython to leave me with plain ASCII).
I'm seeing a lot of blank lines that don't appear in ipython or bpython, and statements that don't produce any output sometimes get echoed. Sometimes not. I can't figure out exactly what circumstances cause the echoing. Example:
bpython:
>>> import time
>>> time.sleep(1)
>>>
ipython:
In [1]: import time
In [2]: time.sleep(1)
In [3]:
bipython:
In [1]: import time
In [3]: time.sleep(1)
In [3]: time.sleep(1) #white
In [3]: #blue
In [4]: #blue
Entering empty statements also produces the echoing:
In [6]: 1 #blue
Out[6]: 1 #red
In [7]: #blue
In [7]: #white
In [7]: #blue
In [7]: #white
In [7]: #blue
On the current master, URWIDRepl.echod is defined to take one non-self argument, but in some places, like connect_ipython_kernel, it's called with two non-self arguments. That gave me this error (when trying to print another error):
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin/bipython", line 9, in <module>
load_entry_point('bipython==0.1.2', 'console_scripts', 'bipython')()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bipython-0.1.2-py2.7.egg/bipython/__init__.py", line 1769, in main
myrepl = URWIDRepl(event_loop, palette, interpreter, config)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bipython-0.1.2-py2.7.egg/bipython/__init__.py", line 651, in __init__
self.ipython = self.connect_ipython_kernel()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bipython-0.1.2-py2.7.egg/bipython/__init__.py", line 708, in connect_ipython_kernel
self.echod(":IPython " + s + " failed", "Info")
TypeError: echod() takes exactly 2 arguments (3 given)
What's the intended signature?
Getting the error "Mircrosoft Visual C++ 10.0 is required (Unable to find vcvarshall.bat" during pip install.
Then if I try to run bipython, I get "fcntl" is not defined.
Could you provide a wheel for it ?
I installed bipython via pip on OSX. When trying to start it, I get the following error:
Traceback (most recent call last):
File "/usr/local/bin/bipython", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: ipython>=1.0
I definitely have ipython installed:
$ pip freeze
...
ipython==3.1.0
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.