在Ubuntu 14.04上安装Python 3的trepan调试器

时间:2014-10-15 09:04:10

标签: python ubuntu python-3.x trepan

我正在使用Ubuntu 14.04和Python 2.7.6版。我最近使用pyenv与系统Python并排安装了Python 3.4.2版。现在我想测试一些Python 3的调试器,然后从python3-trepan project page下载了trepan-0.2.8-py3.3.egg

然后我运行了pyenv global 3.4.2easy_install trepan-0.2.8-py3.3.egg,这给了我以下错误:

Traceback (most recent call last):
  File "/home/hakon/.pyenv/versions/3.4.2/bin/easy_install", line 11, in <module>
    sys.exit(main())
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1909, in main
    with_ei_usage(lambda:
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1896, in with_ei_usage
    return f()
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1913, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 358, in run
    self.easy_install(spec, not self.no_deps)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 574, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 625, in install_item
    self.process_distribution(spec, dist, deps)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 671, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/pkg_resources.py", line 564, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/pkg_resources.py", line 802, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/pkg_resources.py", line 814, in obtain
    return installer(requirement)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 623, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1000, in run_setup
    run_setup(setup_script, args)
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py", line 50, in run_setup
    lambda: execfile(
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py", line 100, in run
    return func()
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py", line 52, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/compat.py", line 78, in execfile
    exec(compile(source, fn, 'exec'), globs, locs)
  File "setup.py", line 12, in <module>
ImportError: No module named '__pkginfo__'

更新

问题似乎与使用pyenv安装Python 3无关:我尝试了以下内容:

  • 已停用pyenv
  • sudo apt-get install python3 python
  • sudo apt-get install python3-setuptools
  • sudo easy_install-3.4 trepan-0.2.8-py3.3.egg

这给了我同样的错误:

Traceback (most recent call last):
  File "/usr/bin/easy_install-3.4", line 9, in <module>
    load_entry_point('setuptools==3.3', 'console_scripts', 'easy_install-3.4')()
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1963, in main
    with_ei_usage(lambda:
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1950, in with_ei_usage
    return f()
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1967, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 381, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 597, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 648, in install_item
    self.process_distribution(spec, dist, deps)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 694, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 620, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 858, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 870, in obtain
    return installer(requirement)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 646, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1025, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 50, in run_setup
    lambda: execfile(
  File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 100, in run
    return func()
  File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 52, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "/usr/lib/python3/dist-packages/setuptools/compat.py", line 78, in execfile
    exec(compile(source, fn, 'exec'), globs, locs)
  File "setup.py", line 12, in <module>
ImportError: No module named '__pkginfo__'

3 个答案:

答案 0 :(得分:1)

我还没有测试过,但维护者@rocky建议安装:

pip3 install trepan3k

<强> OLD

使用此命令安装:

pip3 install -e git+https://github.com/rocky/python3-trepan/#egg=trepan

我认为目前的tarball /鸡蛋已经坏了

答案 1 :(得分:1)

从trepan 0.4.2开始(在撰写本文时我们处于0.4.7),解决了点子问题。但是......

您正在使用pyenv,但请注意,在没有它的情况下,您可能需要使用 pip3 而不是 pip 。在pyenv之外我认为默认 pip 到Python2的 pip 。另请参阅this link

唉,还有另一种奇怪之处。当一个轮子不可用时(就像版本0.4.7之前的情况一样),pip使用源tarball来安装而不是一个鸡蛋。但是,Python 2与Python 3的源代码必然不同,尝试将这些代码组合成一个源代码太难了。

所以,我已经开始在pypi.org上放置wheel格式文件,我希望这也将在未来解决这样的问题。

答案 2 :(得分:0)