我想安裝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 pip
和pip 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
然後我不知道下一步該怎麼做。
我試過這個,實際上並不工作,python3-pip軟件似乎不存在。 – Phoenix