pip3 install scrapy doesn't work and return a

2019-07-25 02:09发布

Python 3 is not my default version. I want to use it, because one the package I want to use toripchanger is only avaible under Python3.

So my pip3 version is:

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

When I run the command

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\

I already tried this

pip3 install setuptools

and this

pip3 install wheel

because I saw that in another topic, but it does not work and I get the same error.

3条回答
ら.Afraid
2楼-- · 2019-07-25 02:48

Try updating:

pip3 install --upgrade setuptools  
查看更多
女痞
3楼-- · 2019-07-25 03:03

It sounds like you don't have the requirements for building the twisted wheel.
I know for sure compiling anything for python on windows requires the Visual C++ Build Tools, and installing those might be enough to get your pip command to work.

Another solution would be to download a pre-built one from https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted and install it. (pip3 install file_you_downloaded.whl)
Once twisted is installed, try installing scrapy again.

查看更多
看我几分像从前
4楼-- · 2019-07-25 03:10

Maybe for your case the best choice is to install Anaconda or Miniconda tools.

查看更多
登录 后发表回答