YuvVij
YuvVij

Reputation: 133

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?

Upvotes: 5

Views: 19251

Answers (6)

noone
noone

Reputation: 1

scrapy -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']

remember to check the python version that scrapy is compatible with.

I have spend my whole day trying to solve the issue. Then finally realised python 3.9.1 is not supported. After that, I've setup a virtual environment with python 3.6. Used pip install scrapy and it works.

Can check this guy's youtube video out to setup a virtual environment: https://www.youtube.com/watch?v=mIB7IZFCE_k&ab_channel=TechWithTim

Hope it helps xD

Upvotes: 0

Derin
Derin

Reputation: 21

if you're using anaconda simply try conda install Twisted in the Anaconda prompt. This helped me resolve my issue with trying to install scrapy using pip. i.e I entered conda install scrapy and all the errors I was facing where no more. Even got some new packages and updated some already installed ones in the process. Sharing cause it worked for me.

Upvotes: -1

Mehran
Mehran

Reputation: 189

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

Upvotes: 6

dan
dan

Reputation: 1

what I did was to uninstall the entire python program from Window OS (please for those using other OS you can also try it).

Reinstall the entire program and install the Twisted packages again.

Upvotes: 0

Psychotechnopath
Psychotechnopath

Reputation: 2744

You should not use a wheel of a python version that isn't stable. Python 3.8 is still under development, there are no stable versions out there (yet). You should use the wheel install for python 3.7: pip install Twisted-19.2.1-cp37-cp37m-win_amd64.whl

Upvotes: 4

Abhishek-Saini
Abhishek-Saini

Reputation: 743

you can try to install any python library with Pycharm IDE in Settings > Environment > Interpreter and then install the required library you want to install. the only thing who have to take care is that you have selected the proper Interpreter which is used by your system.

This is an alternative way if you didn't want to use the command line.

Upvotes: 0

Related Questions