- Saved searches
- Use saved searches to filter your results more quickly
- ImportError: No module named twisted #1088
- ImportError: No module named twisted #1088
- Comments
- No module named ‘Twisted’
- Saved searches
- Use saved searches to filter your results more quickly
- Issue with installing sslstrip #27
- Issue with installing sslstrip #27
- Comments
- ImportError: No module named twisted
- 5 Answers 5
- ImportError: No module named twisted.internet
- 7 Answers 7
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
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
ImportError: No module named twisted #1088
ImportError: No module named twisted #1088
Comments
I installed the Scrapy by following http://doc.scrapy.org/en/latest/topics/ubuntu.html#topics-ubuntu. The installation went perfectly. But when I run
scrapy startproject myproject
I got the following error
Traceback (most recent call last): File "/home/karan/coding/bin/scrapy", line 7, in from scrapy.cmdline import execute File "/home/karan/coding/local/lib/python2.7/site-packages/scrapy/__init__.py", line 50, in from twisted import version as _txv ImportError: No module named twisted
The text was updated successfully, but these errors were encountered:
It seems you had other Scrapy version installed because if Scrapy is installed from PPA the scrapy binary shouldn’t be in /home/karan/coding/bin/scrapy .
@pablohoffman @curita I am working on gsoc project ‘simplified scrapy add-ons’. I have submitted my proposal on google-melange for feedback. I read this , and have few questions, how the order to the extensions are assigned? Is there any rules for the ordering number? Other than settings which files needs edit for adding a new extensions. Also please communicate me the appropriate medium for discussion or timings for IRC chat.
@karan10 I’ve just commented your proposal in Melange, please check it. Let’s try to keep the discussion in Github, but we should use a proper issue related to your idea to discuss it (this one is a support issue for installing Scrapy, that should be closed because you already fix it).
I recommend you to engage in the discussion of #591, that’s the issue discussing sep-021’s implementation.
No module named ‘Twisted’
I just installed Python to start experimenting a bit with Scrapy. Found a tutorial to first install Miniconda and with this I was able to install Scrapy. Now the problem is that the software I’m trying to run also requires Twisted. So I installed twisted with pip. Twisted seems to have been installed correctly but I’m still getting an error when running the script that the Twisted module could not be found.
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================ RESTART: C:\xampp\htdocs\crawler\crawler.py ================ Traceback (most recent call last): File "C:\xampp\htdocs\crawler\crawler.py", line 3, in from scrapy.utils.project import get_project_settings File "C:\xampp\htdocs\crawler\scrapy\__init__.py", line 43, in from twisted import version as _txv ModuleNotFoundError: No module named 'twisted' >>> ================ RESTART: C:\xampp\htdocs\crawler\crawler.py ================ Traceback (most recent call last): File "C:\xampp\htdocs\crawler\crawler.py", line 3, in from scrapy.utils.project import get_project_settings File "C:\xampp\htdocs\crawler\scrapy\__init__.py", line 43, in from twisted import version as _txv ModuleNotFoundError: No module named 'twisted' >>>
This sometimes happens if you have more than one python versions installed. Do which python and make sure you’re working on the same env
According the scrapy’s official document, you shouldn’t use pip install scrapy on windows, instead you should use conda install -c conda-forge scrapy . (If you use the pypi one, you need to install Visual Studio C++ 14.0 compiler)
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
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
Issue with installing sslstrip #27
Issue with installing sslstrip #27
Comments
Hi,
I am facing some issues while installing the sslstrip
I run the following command:
python setup.py build && python setup.py install
then when i run:
sslstrip -h
Traceback (most recent call last):
File «/usr/local/bin/sslstrip», line 27, in
from twisted.web import http
ImportError: No module named twisted.web
I have tried installing twisted module using apt-get but unfortunately it is not there anymore
apt-get install python-twisted
Reading package lists. Done
Building dependency tree
Reading state information. Done
Package python-twisted is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘python-twisted’ has no installation candidate
when i install it using pip3 is shows that it is there
pip3 install twisted
Requirement already satisfied: twisted in /usr/lib/python3/dist-packages (18.9.0)
so please can you guide me for the proper way to install it
The text was updated successfully, but these errors were encountered:
ImportError: No module named twisted
I’m pretty new to python and twisted and I tried to run a simple twisted script but failed. My environment: MacOX 10.7.2 + Python 2.7.1 + Twisted 11.0.0 + eclipse + PyDev The script called test.py:
from twisted import reactor reactor.run()
I tried to run it in the terminal and everything works fine. Then I opened eclipse and created a new PyDev project then adding a py file called test.py and typed the code above in. When I tried to run it I got errors like:
Traceback (most recent call last): File "/Users/user/Documents/workspace/TwistedDemo/test.py", line 2, in from twisted import reactor ImportError: No module named twisted
Then I checked the PYTHONPATH and added the «twisted source folder» in the external libraries tab but the errors was still there.(nothing changed) Hope someone can help me out here, thanks in advance 🙂
Are you sure you added the folder that contains the folder named twisted , and not that folder itself?
5 Answers 5
Several things to try here —
- Since your env is Mac OSX. I installed commandline tools from Xcode which solved this problem. Xcode 4.4 and later install Command Line Tools
- For the sake of completeness. If this on Ubuntu, then apt-get install python-twisted generally works.
- from your eclipse put this in your python script — python -c ‘import sys;print sys.path’ This tells all the paths that python looks for when you import something . If you don’t find twisted path there then add it to this like so — sys.path.append(twisted_dir_path)
- Finally, if all the above does not help. type -p python in a shell will tell you which version you’re using; I would mostly be /usr/bin/ or some variant of it. Then /usr/bin/python2.7 -c ‘from twisted.internet.protocol import Factory,Protocol’ ought to succeed.
Updating Xcode did the trick for me 🙂 Thanks! Ps: remember to restart the terminal tab after update/installation.
This has happened to me so many times, but I figured out previously. Basically, if you have too many versions of python on your mac, Aptana Studio for some reason gets confused, so make sure that your twisted installation is using the same python as the command line (even though you already added twisted to Aptana). I’ll get into more specifics later
Ok, I think this is how you do it:
- Grab the python path of the python that has twisted installed correctly, using this
import sys
print sys.path
And just grab the base path, nothing to specific. - Go to Aptana-preferences-PyDev-Interpreter-Python
- And then just add a new interpreter (in my case I just called it python1 and set is the first one. If that doesn’t work then just set a new PYTHONPATH right below it.
Hi, I do have too many python installed. that’s why I got an error with segmentation fault 11. any workaround?
@OMGPOP This was a while ago but I let me try to describe the solution in my answer. Give me a couple of hours, I am not at my computer now.
You need to install incremental before twisted
pip install --upgrade incremental pip install Twisted
This should solve the problem.
Not sure how you installed twisted, did you try easy_install or pip, or install in manually?
If you want to make sure it’s installed properly, try opening up a terminal, typing python, and then «import twisted». If it comes back without errors, then it’s installed. You might need to set the PYTHONPATH variable to include the source folder.
Then, since you’re using pydev in eclipse, you need to refresh your configuration each time you add a new library.
On the mac, this is under preferences -> PyDev -> Interperter-Python
I find it works best to remove my configuration and re-add it, for it to pick up everything. But you can click on new folder (select the folder with the init.py), or the new egg, if it’s an easy_install egg (a .egg file is a zip file, if it’s unzipped, you’ll see a EGG-INFO folder in the subdirectory of the folder you want to select).
ImportError: No module named twisted.internet
I installed python 2.7.5 which is working fine. I then install scrapy (which, I think, uses twisted internally). My scrapy spider is also working fine. I installed twisted:
from twisted.internet import protocol, reactor class Echo(protocol.Protocol): def dataReceived(self, data): self.transport.write(data) class EchoFactory(protocol.Factory): def buildProtocol(self, addr): return Echo() reactor.listenTCP(1234, EchoFactory()) reactor.run()
$ python twistedTester.py Traceback (most recent call last): File "twistedTester.py", line 1, in from twisted.internet import protocol, reactor ImportError: No module named twisted.internet
Can anyone help me with how I can debug why my twisted package is not being picked up by Python installation?
Try running which python — what does it tell you? What about which python2.7 ? How about python -c «import twisted; print(twisted)» ? Do you perhaps have a file called twisted.py somewhere on sys.path ?
7 Answers 7
The same works with w3lib and lxml.
On some *nix systems this might give you a permission error. If that happens, try:
sudo -H pip install twisted
This worked for me, also, note, on mac os X it may say «error 1:permission denied» unless sudo is used. «sudo pip install twisted»
I figured out why this error was happening. For some reason, using apt-get to install a python package was not installing it right.
So, I had to download a tar ball and install the package from them.
I downloaded Twisted tar from here.
I did a tar xjf Twisted-13.1.0.tar.bz2 — this created a directory called Twisted-13.1.0
next, cd Twisted-13.1.0 Finally, python setup.py install
This gave me an error. Twisted required another package called zope.interface. So, I downloaded tar ball for zope.interface from here. Then, ran this command tar xzf zope.interface-3.6.1.tar.gz That created a folder called zope.interface-3.6.1. So, cd into zope.interface-3.6.1 and run python setup.py install
Note: Depending on your user’s rights, you may want to do these commands in sudo mode. Just add the keyword sudo before every command.