pip3 install scrapy不起作用并返回错误代码1

问题描述 投票:1回答:3

Python 3不是我的默认版本。我想使用它,因为我想使用toripchanger的软件包只能在Python3下使用。

所以我的pip3版本是:

C:\Users\Truc>pip3 -V
pip 19.0.2 from c:\python\python37\lib\site-packages\pip (python 3.7)

当我运行命令

C:\Users\Truc>pip3 install scrapy
... #a lot of lines
#then
Command "c:\python\python37\python.exe -u -c "import setuptools, tokenize;
__file__='C:\\Users\\Truc\\AppData\\Local\\Temp\\pip-install-hw8khaqe\\Twisted\\setup.py';
f=getattr(tokenize, 'open',open(__file__);
code=f.read().replace('\r\n','\n');
f.close();
exec(compile(code, __file__, 'exec'))" install 
--record C:\Users\Truc\AppData\Local\Temp\pip-record-msw6xh4l\install-record.txt 
--single-version-externally-managed 
--compile" 
failed with error code 1 in C:\Users\Truc\AppData\Local\Temp\pip-install-hw8khaqe\Twisted\

我已经试过了

pip3 install setuptools

还有这个

pip3 install wheel

因为我在另一个主题中看到了它,但它不起作用,我得到了同样的错误。

python python-3.x scrapy pip
3个回答
1
投票

听起来你没有建造扭转轮的要求。 我知道肯定在Windows上为python编译任何东西需要Visual C++ Build Tools,并且安装这些可能足以让你的pip命令工作。

另一种解决方案是从https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted下载预先构建的一个并安装它。 (pip3 install file_you_downloaded.whl) 一旦安装了扭曲,请尝试再次安装scrapy。


0
投票

也许对于您的情况,最好的选择是安装Anaconda or Miniconda工具。


-1
投票

尝试更新:

pip3 install --upgrade setuptools  
© www.soinside.com 2019 - 2024. All rights reserved.