Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Installing in a python 3.3b2 or python 3.3rc1 virtual environment. #2343

Closed
andrewspiers opened this Issue · 2 comments

2 participants

Andrew Spiers Bradley M. Froehle
Andrew Spiers

Hi, I'm having trouble installing inside a venv.

I activate the venv, install distribute, install ipython:
python setup.py install
and then when trying to run the ipython3 binary which is installed, I get
'TypeError: init() got an unexpected keyword argument 'version'
Have I perhaps missed some necessary dependency?

Traceback is given below. I've tried the git version of ipython, and
ipython 0.13.

(ipythontest) andrew@wiki:~/ipythontest/bin$ ./ipython3
Traceback (most recent call last):
File "./ipython3", line 9, in
load_entry_point('ipython==0.14.dev', 'console_scripts', 'ipython3')()
File "/home/andrew/ipythontest/lib/python3.3/site-packages/distribute-0.6.28-py3.3.egg/pkg_resources.py",
line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/andrew/ipythontest/lib/python3.3/site-packages/distribute-0.6.28-py3.3.egg/pkg_resources.py",
line 2312, in load_entry_point
return ep.load()
File "/home/andrew/ipythontest/lib/python3.3/site-packages/distribute-0.6.28-py3.3.egg/pkg_resources.py",
line 2018, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/init.py",
line 46, in
from .frontend.terminal.embed import embed
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/frontend/terminal/embed.py",
line 40, in
from IPython.frontend.terminal.ipapp import load_default_config
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/frontend/terminal/ipapp.py",
line 46, in
from IPython.core.magics import ScriptMagics
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/core/magics/init.py",
line 17, in
from .basic import BasicMagics
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/core/magics/basic.py",
line 37, in
class BasicMagics(Magics):
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/core/magics/basic.py",
line 61, in BasicMagics
def alias_magic(self, line=''):
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/core/magic_arguments.py",
line 173, in call
func.parser = construct_parser(func)
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/core/magic_arguments.py",
line 103, in construct_parser
parser = MagicArgumentParser(arg_name, **kwds)
File "/home/andrew/ipythontest/lib/python3.3/site-packages/ipython-0.14.dev-py3.3.egg/IPython/core/magic_arguments.py",
line 82, in init
conflict_handler=conflict_handler, add_help=add_help)
TypeError: init() got an unexpected keyword argument 'version'

Matthias Bussonnier suggests:
"version" keyword seem to be deprecated even in 2.7, it might have been dropped in the version of python you use, so it a bug on our side.

http://hg.python.org/cpython/file/2.7/Lib/argparse.py
1557 if version is not None:
1558 import warnings
1559 warnings.warn(
1560 """The "version" argument to ArgumentParser is deprecated. """
1561 """Please use """
1562 """"add_argument(..., action='version', version="N", ...)" """
1563 """instead""", DeprecationWarning)

Background:
I'm running Debian squeeze, I installed the dependencies listed in the
debian .dsc file for python 3 before doing a source install. That is,
the following packages:
quilt autoconf libreadline6-dev libncursesw5-dev zlib1g-dev
libdb4.8-dev tk8.5-dev blt-dev libssl-dev sharutils libbz2-dev
libbluetooth-dev locales libsqlite3-dev libffi-dev mime-support
libgpm2 netbase lsb-release bzip2 gdb

Andrew Spiers

This seems to fix it:

diff --git a/IPython/core/magic_arguments.py b/IPython/core/magic_arguments.py
index ca83da9..ce43bd6 100644
--- a/IPython/core/magic_arguments.py
+++ b/IPython/core/magic_arguments.py
@@ -66,7 +66,6 @@ def __init__(self,
                  usage=None,
                  description=None,
                  epilog=None,
-                 version=None,
                  parents=None,
                  formatter_class=MagicHelpFormatter,
                  prefix_chars='-',
@@ -76,7 +75,7 @@ def __init__(self,
         if parents is None:
             parents = []
         super(MagicArgumentParser, self).__init__(prog=prog, usage=usage,
-            description=description, epilog=epilog, version=version,
+            description=description, epilog=epilog, 
             parents=parents, formatter_class=formatter_class,
             prefix_chars=prefix_chars, argument_default=argument_default,
             conflict_handler=conflict_handler, add_help=add_help)
Matthias Bussonnier Carreau referenced this issue from a commit in Carreau/ipython
Matthias Bussonnier Carreau version keyword deprecated in argparse
fixes #2343
a5e9474
Andrew Spiers andrewspiers referenced this issue from a commit in andrewspiers/ipython
Andrew Spiers andrewspiers Update IPython/core/magic_arguments.py
Remove references to 'version' no longer in argparse. Github issue #2343.
bd48d38
Bradley M. Froehle
Collaborator

I believe this was fixed in #2345.

Bradley M. Froehle bfroehle closed this
Min RK minrk referenced this issue from a commit
Min RK minrk Backport PR #2345: Remove references to 'version' no longer in argpar…
…se. Github issue #2343.

Remove references to 'version' no longer in argparse. Github issue #2343.
001751a
Min RK minrk referenced this issue from a commit
Min RK minrk Backport PR #2345: Remove references to 'version' no longer in argpar…
…se. Github issue #2343.

Remove references to 'version' no longer in argparse. Github issue #2343.
8ad2612
Matthias Bussonnier Carreau referenced this issue from a commit in Carreau/ipython
Andrew Spiers andrewspiers Update IPython/core/magic_arguments.py
Remove references to 'version' no longer in argparse. Github issue #2343.
7052ce3
Cameron Bates crbates referenced this issue from a commit in crbates/ipython
Andrew Spiers andrewspiers Update IPython/core/magic_arguments.py
Remove references to 'version' no longer in argparse. Github issue #2343.
738770b
Yaroslav Halchenko yarikoptic referenced this issue from a commit in yarikoptic/ipython
Yaroslav Halchenko yarikoptic Merge tag 'rel-0.13.1' into debian-01X
* tag 'rel-0.13.1': (27 commits)
  remove rc for 0.13.1 final
  0.13.1.rc3
  qtconsole extras_require to whatsnew
  Backport PR #2492: add missing 'qtconsole' extras_require
  add 2480 to whatsnew
  Backport PR #2480: Add deprecation warnings for sympyprinting
  PR 2384 to whatsnew
  mark 0.13.1.rc2
  Backport PR #2384: Adapt inline backend to changes in matplotlib
  mark 0.13.1.rc1
  update 0.13.1 whatsnew lists
  Backport PR #2479: use new _winapi instead of removed _subprocess
  Backport PR #2437: don't let log cleanup prevent engine start
  Backport PR #2405: clarify TaskScheduler.hwm doc
  Backport PR #2377: Fix installation of man pages in Python 3
  start 0.13.1 whatsnew
  Backport PR #2373: fix missing imports in core.interactiveshell
  Backport PR #2365: fix names of notebooks for download/save
  Backport PR #2345: Remove references to 'version' no longer in argparse. Github issue #2343.
  Backport PR #2347: adjust division error message checking to account for Python 3
  ...
12b344d
Yaroslav Halchenko yarikoptic referenced this issue from a commit in yarikoptic/ipython
Yaroslav Halchenko yarikoptic Merge tag 'rel-0.13.1' (mtheirs) into releases
* tag 'rel-0.13.1': (51 commits)
  remove rc for 0.13.1 final
  0.13.1.rc3
  qtconsole extras_require to whatsnew
  Backport PR #2492: add missing 'qtconsole' extras_require
  add 2480 to whatsnew
  Backport PR #2480: Add deprecation warnings for sympyprinting
  PR 2384 to whatsnew
  mark 0.13.1.rc2
  Backport PR #2384: Adapt inline backend to changes in matplotlib
  mark 0.13.1.rc1
  update 0.13.1 whatsnew lists
  Backport PR #2479: use new _winapi instead of removed _subprocess
  Backport PR #2437: don't let log cleanup prevent engine start
  Backport PR #2405: clarify TaskScheduler.hwm doc
  Backport PR #2377: Fix installation of man pages in Python 3
  start 0.13.1 whatsnew
  Backport PR #2373: fix missing imports in core.interactiveshell
  Backport PR #2365: fix names of notebooks for download/save
  Backport PR #2345: Remove references to 'version' no longer in argparse. Github issue #2343.
  Backport PR #2347: adjust division error message checking to account for Python 3
  ...
39b9601
matthew von rocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
Andrew Spiers andrewspiers Update IPython/core/magic_arguments.py
Remove references to 'version' no longer in argparse. Github issue #2343.
7f72a1f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.