1

我正在使用带有 Python 版本 2.7.6 的 Ubuntu 14.04。我最近使用pyenv. 现在我想测试一些 Python 3 的调试器,我trepan-0.2.8-py3.3.eggpython3-trepan 项目页面下载。

然后我跑了pyenv global 3.4.2and easy_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__'

更新:

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

  • 禁用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__'
4

3 回答 3

1

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

pip3 install trepan3k

使用以下命令安装:

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

我认为当前的 tarball/eggs 已损坏

于 2015-02-01T16:58:51.780 回答
1

从 Trepan 0.4.2 开始(在撰写本文时,我们处于 0.4.7),pip 问题得到了解决。然而...

您正在使用 pyenv 但请注意,在没有它的 Ubuntu 14.04 上,您可能需要使用pip3而不是pip。在 pyenv 之外,我认为默认pip为 Python2 的pip。另请参阅此链接

唉,还有另一个奇怪的地方。当轮子不可用时(如版本 0.4.7 之前的情况),pip 使用源 tarball 来安装而不是鸡蛋。然而,Python 2 和 Python 3 的源代码必然是不同的,尝试将它们组合成一个源代码太困难了。

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

于 2015-05-11T01:49:56.040 回答
0

您可以查看https://askubuntu.com/questions/95037/what-is-the-best-way-to-install-python-packageshttps://askubuntu.com/questions/350437/installing- python-modules-on-ubuntu在 Ubuntu 上安装 python 模块

这可能会解决问题。希望能帮助到你。

于 2014-10-15T09:13:48.787 回答