Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twisted Error using 'pipenv install twisted #36

Closed
winrg opened this issue Mar 9, 2019 · 6 comments
Closed

Twisted Error using 'pipenv install twisted #36

winrg opened this issue Mar 9, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@winrg
Copy link

winrg commented Mar 9, 2019

Upon trying to run scrapy, I got an error. reading through it, I discovered it required twisted. I installed it using "sudo pipenv install twisted", I got this terminal out. I am doing this on a chromebook using the native debian VM.

@MartinSeibert
Copy link

I ha the same problem in a ubuntu 16.04 crouton on a chromebook. This stackoverflow solution worked for me: https://stackoverflow.com/questions/31457009/error-installing-twisted-for-python

I had to run the following before installing twisted: sudo apt-get install python3-dev

@jeslevine
Copy link

Install .whl file from here and make sure the c3x version of python matches
https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

@bonfirefan
Copy link
Collaborator

bonfirefan commented Apr 27, 2019

  1. Install C++ Build Tools from here (only select build tools, ~3GB): https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017

  2. Download wheel files from the link jess posted
    Make sure the filename matches your version of python in the (27, 33, 37) etc. (So if you have Python 3.6 and Windows 64bit, install Twisted‑19.7.0‑cp36‑cp36m‑win_amd64.whl )

  3. Run pip install [wheel.whl] where you downloaded the wheel

@bonfirefan bonfirefan added the bug Something isn't working label Apr 27, 2019
This was referenced Aug 28, 2019
@biniona
Copy link

biniona commented Nov 2, 2019

I am having a twisted bug on OSX 10.14.6. After entering my forked directory and running pipenv install --dev --ignore-pipfile --three . I try to run scrapy genspider chi_housing "Chicago Housing Authority" http://www.thecha.org and get the error ModuleNotFoundError: No module named 'twisted'. I tried to run

pip install twisted and
pip3 install twisted outside of pipenv shell

MESSAGE :
alekbinsmacbook:~ AlekB$ pip3 install twisted Requirement already satisfied: twisted in ./miniconda3/lib/python3.6/site-packages (19.2.1) Requirement already satisfied: hyperlink>=17.1.1 in ./miniconda3/lib/python3.6/site-packages (from twisted) (19.0.0) Requirement already satisfied: attrs>=17.4.0 in ./miniconda3/lib/python3.6/site-packages (from twisted) (19.1.0) Requirement already satisfied: Automat>=0.3.0 in ./miniconda3/lib/python3.6/site-packages (from twisted) (0.7.0) Requirement already satisfied: incremental>=16.10.1 in ./miniconda3/lib/python3.6/site-packages (from twisted) (17.5.0) Requirement already satisfied: PyHamcrest>=1.9.0 in ./miniconda3/lib/python3.6/site-packages (from twisted) (1.9.0) Requirement already satisfied: constantly>=15.1 in ./miniconda3/lib/python3.6/site-packages (from twisted) (15.1.0) Requirement already satisfied: zope.interface>=4.4.2 in ./miniconda3/lib/python3.6/site-packages (from twisted) (4.6.0) Requirement already satisfied: idna>=2.5 in ./miniconda3/lib/python3.6/site-packages (from hyperlink>=17.1.1->twisted) (2.6) Requirement already satisfied: six in ./miniconda3/lib/python3.6/site-packages (from Automat>=0.3.0->twisted) (1.12.0) Requirement already satisfied: setuptools in ./miniconda3/lib/python3.6/site-packages (from PyHamcrest>=1.9.0->twisted) (41.0.1)

and pipenv install twisted before going into pipenv.

All seemed to be successful but the error is still happening.

Any ideas what I should try?


Sections of error message when running pip install twisted when in pipenv shell (full error message is unreasonably long)

ERROR: Command errored out with exit status 1: command: /Users/AlekB/.virtualenvs/city-scrapers-pitt-yoEmy647/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-install-n1jkz4xl/twisted/setup.py'"'"'; __file__='"'"'/private/var/folders/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-install-n1jkz4xl/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/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-wheel-y37x3pla --python-tag cp37 cwd: /private/var/folders/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-install-n1jkz4xl/twisted/

...

running build_ext building 'twisted.test.raiser' extension creating build/temp.macosx-10.14-x86_64-3.7 creating build/temp.macosx-10.14-x86_64-3.7/src creating build/temp.macosx-10.14-x86_64-3.7/src/twisted creating build/temp.macosx-10.14-x86_64-3.7/src/twisted/test /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/twisted/test/raiser.c -o build/temp.macosx-10.14-x86_64-3.7/src/twisted/test/raiser.o clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot] In file included from src/twisted/test/raiser.c:4: /opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:25:10: fatal error: 'stdio.h' file not found #include <stdio.h> ^~~~~~~~~ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/AlekB/.virtualenvs/city-scrapers-pitt-yoEmy647/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-install-n1jkz4xl/twisted/setup.py'"'"'; __file__='"'"'/private/var/folders/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-install-n1jkz4xl/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 /private/var/folders/xf/1f4dfks55slcjxl6s7b5dty40000gn/T/pip-record-edgdrx_1/install-record.txt --single-version-externally-managed --compile --install-headers /Users/AlekB/.virtualenvs/city-scrapers-pitt-yoEmy647/bin/../include/site/python3.7/twisted Check the logs for full command output.

hope some of this information says something about the error.

@biniona
Copy link

biniona commented Nov 4, 2019

Solved the problem for Mac OSX Mojave twisted error! I think the issue had to do with me having too many versions of python on my machine and a bunch of dependencies got jumbled up. I attempted to deinstall all my versions of python and then reinstall python 3.7 by following these two links and it worked.

Also reinstalled pipenv during the process (a licensing error came up). I am down to talk about this more if anyone else gets the same error.

SUMMARY: It had pretty much nothing to do with twisted. Seemed more to be an issue with my having weird linking and dependency stuff and I just had to delete all my python versions and reinstall the one I needed for this project.

@ben-nathanson
Copy link

Duplicated by #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants