以前からpython 3.6.4にscrapyをインストールしようと試みています。OSはwindows7しかしながらエラーが出てしまいインストールまで至りません。
以下がエラー-コードです。
Active code page: 866
C:\Users\user>pip install scrapy
Collecting scrapy
Using cached Scrapy-1.5.0-py2.py3-none-any.whl
Requirement already satisfied: pyOpenSSL in c:\users\user\appdata\local\programs\python\python3
6\lib\site-packages (from scrapy)
Requirement already satisfied: PyDispatcher>=2.0.5 in c:\users\user\appdata\local\programs\pyth
on\python36\lib\site-packages (from scrapy)
Collecting Twisted>=13.1.0 (from scrapy)
Using cached Twisted-17.9.0.tar.bz2
Requirement already satisfied: six>=1.5.2 in c:\users\user\appdata\local\programs\python\python
36\lib\site-packages (from scrapy)
Requirement already satisfied: parsel>=1.1 in c:\users\user\appdata\local\programs\python\pytho
n36\lib\site-packages (from scrapy)
Requirement already satisfied: queuelib in c:\users\user\appdata\local\programs\python\python36
\lib\site-packages (from scrapy)
Requirement already satisfied: service-identity in c:\users\user\appdata\local\programs\python
python36\lib\site-packages (from scrapy)
Requirement already satisfied: w3lib>=1.17.0 in c:\users\user\appdata\local\programs\python\pyt
hon36\lib\site-packages (from scrapy)
Requirement already satisfied: lxml in c:\users\user\appdata\local\programs\python\python36\lib
\site-packages (from scrapy)
Requirement already satisfied: cssselect>=0.9 in c:\users\user\appdata\local\programs\python\py
thon36\lib\site-packages (from scrapy)
Requirement already satisfied: cryptography>=2.1.4 in c:\users\user\appdata\local\programs\pyth
on\python36\lib\site-packages (from pyOpenSSL->scrapy)
Requirement already satisfied: zope.interface>=4.0.2 in c:\users\user\appdata\local\programs\py
thon\python36\lib\site-packages (from Twisted>=13.1.0->scrapy)
Requirement already satisfied: constantly>=15.1 in c:\users\user\appdata\local\programs\python
python36\lib\site-packages (from Twisted>=13.1.0->scrapy)
Requirement already satisfied: incremental>=16.10.1 in c:\users\user\appdata\local\programs\pyt
hon\python36\lib\site-packages (from Twisted>=13.1.0->scrapy)
Requirement already satisfied: Automat>=0.3.0 in c:\users\user\appdata\local\programs\python\py
thon36\lib\site-packages (from Twisted>=13.1.0->scrapy)
Requirement already satisfied: hyperlink>=17.1.1 in c:\users\user\appdata\local\programs\python
\python36\lib\site-packages (from Twisted>=13.1.0->scrapy)
Requirement already satisfied: attrs in c:\users\user\appdata\local\programs\python\python36\li
b\site-packages (from service-identity->scrapy)
Requirement already satisfied: pyasn1 in c:\users\user\appdata\local\programs\python\python36\l
ib\site-packages (from service-identity->scrapy)
Requirement already satisfied: pyasn1-modules in c:\users\user\appdata\local\programs\python\py
thon36\lib\site-packages (from service-identity->scrapy)
Requirement already satisfied: idna>=2.1 in c:\users\user\appdata\local\programs\python\python3
6\lib\site-packages (from cryptography>=2.1.4->pyOpenSSL->scrapy)
Requirement already satisfied: asn1crypto>=0.21.0 in c:\users\user\appdata\local\programs\pytho
n\python36\lib\site-packages (from cryptography>=2.1.4->pyOpenSSL->scrapy)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in c:\users
user\appdata\local\programs\python\python36\lib\site-packages (from cryptography>=2.1.4->pyOpen
SSL->scrapy)
Requirement already satisfied: setuptools in c:\users\user\appdata\local\programs\python\python
36\lib\site-packages (from zope.interface>=4.0.2->Twisted>=13.1.0->scrapy)
Requirement already satisfied: pycparser in c:\users\user\appdata\local\programs\python\python3
6\lib\site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.
1.4->pyOpenSSL->scrapy)
Installing collected packages: Twisted, scrapy
Running setup.py install for Twisted ... error
Exception:
Traceback (most recent call last):
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\compat_ini
t_.py", line 73, in console_to_str
return s.decode(sys.stdout.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 3: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\basecommand.
py", line 215, in main
status = self.run(options, args)
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\commands\ins
tall.py", line 342, in run
prefix=options.prefix_path,
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_set.
py", line 784, in install
**kwargs
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_inst
all.py", line 878, in install
spinner=spinner,
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\utils__init
_.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\pip\compat_ini
t.py", line 75, in console_to_str
return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 3: invalid start byte
インストールができない原因は最後の UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 3: invalid start byte だと思います。個別にtwistedだけをpip install twisted しても同様なエラーが出てしまいました。
そこで以下のことを試しました。pip install scrapy を入力する前にchcp 65001 ,chcp 866,chcp 932それぞれを試しています。
参考にしたもの
https://github.com/pypa/pip/issues/4251
https://qiita.com/akabei/items/da70ebf61cc413d5ff0d
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/31 10:45
2018/03/31 11:01 編集
2018/03/31 11:34
2018/03/31 12:12
2018/03/31 12:59
2018/03/31 13:08
2018/03/31 13:16
2018/03/31 13:26 編集