2

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 Answers 3

2

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.

1
  • After run this C:\Python\Python37>pip3 install Twisted-18.9.0-cp37-cp37m-win_amd64.whl --> Installing collected packages: Twisted Successfully; installed Twisted-18.9.0, the installation of scrapy worked well C:\Python\Python37>pip3 install scrapy --> Installing collected packages: scrapy; Successfully installed scrapy-1.6.0. Thank you very much.
    – AvyWam
    Feb 17, 2019 at 20:34
0

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

-1

Try updating:

pip3 install --upgrade setuptools  
1
  • I did two things, the exact command you wrote pip install --upgrade setuptools and even pip3 install --upgrade setuptools, so for the last command I obtain: Requirement already up-to-date: setuptools in c:\python\python37\lib\site-packages (40.8.0), but I still get the same error: failed with error code 1 in C:\Users\Truc\AppData\Local\Temp\pip-install-hw8khaqe\Twisted\ What I can add is during the process of pip3 install scrapy it prints Failed building wheel for Twisted, Running setup.py clean for Twisted
    – AvyWam
    Feb 17, 2019 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.