Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pip install Twisted without getting an Error?

I am trying to install Twisted on Windows 10 by using Pip. I know that there are a lot of other questions about installing Twisted out there, but none of them matched my error. When I run pip install Twisted, I get the following error:

ERROR: Command "'c:\python\python37\python.exe' -u -c 'import setuptools, 
tokenize;__file__='"'"'C:\\Users\\rohan\\AppData\\Local\\Temp\\pip-install-9k3t35yi\\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\rohan\AppData\Local\Temp\pip-record-ec9bnx1z\install-record.txt' 
--single-version-externally-managed --compile" failed with error code 1 in 
C:\Users\rohan\AppData\Local\Temp\pip-install-9k3t35yi\twisted\

I am not a professional programmer and cannot interpret this.

I've tried installing the wheel file, and all I get is:

ERROR: Twisted-19.2.1-cp38-cp38m-win_amd64.whl is not a supported wheel on this platform.

I'm running 64-bit python with a 64-bit pc. What am I doing wrong? I don't use Anaconda. I use PyCharm, and even installing Scrapy(why I need Twisted) from it gives me an error.

Anyone know what I am doing wrong or what I should try?

like image 461
RoXeno Avatar asked Dec 31 '22 19:12

RoXeno


1 Answers

Try downloading the twisted whl file from this link: https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted . Download the file with cp38 in its name.

After downloading the file, open a cmd in that folder and run the command:

pip install <file.whl>

For example, if you downloaded Twisted‑19.7.0‑cp38‑cp38‑win_amd64.whl, use:

pip install Twisted‑19.7.0‑cp38‑cp38‑win_amd64.whl
like image 79
Mehran Avatar answered Jan 04 '23 22:01

Mehran