2013-12-15 81 views
2

我想安装you-get但失败。 Fistly,当我根据项目的README文件运行make install,我得到这个错误:如何在树莓派上安装python 3和setuptools?

[email protected] ~/you-get $ make install 
python3 setup.py bdist_egg 
Traceback (most recent call last): 
    File "setup.py", line 15, in <module> 
    from setuptools import setup, find_packages 
ImportError: No module named setuptools 
make: *** [bdist_egg] Error 1 

我想这是因为Python的setuptool没有安装,所以根据this,我跑的命令,但仍然有以上错误。

然后我试图sudo easy_install pippip install you-get,但得到这个错误:

[email protected] ~ $ sudo pip install you-get 
Downloading/unpacking you-get 
    Downloading you-get-0.3.24.tar.gz (51kB): 51kB downloaded 
    Running setup.py egg_info for package you-get 

Installing collected packages: you-get 
    Running setup.py install for you-get 

    SyntaxError: ("unqualified exec is not allowed in function 'decipher' it contains a nested function with free variables",) 

Successfully installed you-get 
Cleaning up... 

我想看看它是否真的失败了,所以我跑you-get -V,然后得到这个错误:

[email protected] ~ $ you-get -V 
Traceback (most recent call last): 
    File "/usr/local/bin/you-get", line 8, in <module> 
    load_entry_point('you-get==0.3.24', 'console_scripts', 'you-get')() 
    File "build/bdist.linux-armv6l/egg/pkg_resources.py", line 318, in load_entry_point 
    File "build/bdist.linux-armv6l/egg/pkg_resources.py", line 2221, in load_entry_point 
    File "build/bdist.linux-armv6l/egg/pkg_resources.py", line 1954, in load 
    File "/usr/local/lib/python2.7/dist-packages/you_get/__init__.py", line 3, in <module> 
    from .common import * 
    File "/usr/local/lib/python2.7/dist-packages/you_get/common.py", line 9, in <module> 
    from urllib import request, parse 
ImportError: cannot import name request 

我猜测是因为python的版本,在Raspberry Pi上默认的python版本是2.7,但是you-get软件需要python 3,所以我安装了python3并运行这个:

[email protected] ~ $ python3 /usr/bin/you-get 
python3: can't open file '/usr/bin/you-get': [Errno 2] No such file or directory 

[email protected] ~ $ whereis you-get 
you-get: /usr/local/bin/you-get 

[email protected] ~ $ python3 /usr/local/bin/you-get 
Traceback (most recent call last): 
    File "/usr/local/bin/you-get", line 5, in <module> 
    from pkg_resources import load_entry_point 
ImportError: No module named pkg_resources 

然后我不知道下一步该怎么做。

回答

0
sudo apt-get install python3-pip 

或蟒2:

sudo apt-get install python-pip