Search code examples
pythonmacosscrapytwisted

Running setup.py install for Twisted ... error in MacOS


When i install scrapy in Python 3.8.2 in MacOS, Display:

Requirement already satisfied: six in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from Automat>=0.3.0->Twisted) (1.15.0)
Requirement already satisfied: idna>=2.5 in /Library/Python/3.8/site-packages (from hyperlink>=17.1.1->Twisted) (2.10)
Building wheels for collected packages: Twisted
  Building wheel for Twisted (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1w/wtkkznhd5x1f3kgx_x7yjh7r0000gn/T/pip-install-dh7kc0fc/Twisted/setup.py'"'"'; __file__='"'"'/private/var/folders/1w/wtkkznhd5x1f3kgx_x7yjh7r0000gn/T/pip-install-dh7kc0fc/Twisted/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/1w/wtkkznhd5x1f3kgx_x7yjh7r0000gn/T/pip-wheel-de42wco6 --python-tag cp38

Solution

  • use command: brew install python3. update python 3.83 to python 3.85. then restart macos. use command: pip3 install scrapy. it is OK.