Importerror no module named twisted web kali linux

Содержание
  1. Issue with installing sslstrip #27
  2. Comments
  3. anonymous187 commented May 5, 2020
  4. anonymous187 commented May 5, 2020
  5. pip3 install sslstrip Collecting sslstrip Downloading sslstrip-0.9.2.tar.gz (9.2 kB) Collecting Twisted==13.1.0 Downloading Twisted-13.1.0.tar.bz2 (2.7 MB) |████████████████████████████████| 2.7 MB 74 kB/s Collecting pyOpenSSL==0.13.1 Downloading pyOpenSSL-0.13.1.tar.gz (254 kB) |████████████████████████████████| 254 kB 135 kB/s Requirement already satisfied: zope.interface>=3.6.0 in /usr/lib/python3/dist-packages (from Twisted==13.1.0->sslstrip) (4.7.1) Building wheels for collected packages: sslstrip, Twisted, pyOpenSSL Building wheel for sslstrip (setup.py) . done Created wheel for sslstrip: filename=sslstrip-0.9.2-py3-none-any.whl size=14796 sha256=b5c3a7e8ae8768510e5cab995b0387523d48c55d14bee307c1c3730c45a37ef3 Stored in directory: /root/.cache/pip/wheels/fc/9d/90/1e5bc8d868e08c73037090addb2a01cc7b8444151828b5d7fa Building wheel for Twisted (setup.py) . done Created wheel for Twisted: filename=Twisted-13.1.0-cp38-cp38-linux_x86_64.whl size=2920570 sha256=735c6c41bc7f0e6a0969ff28db00af15916a87b14d57ddfebcaf61332402a6d9 Stored in directory: /root/.cache/pip/wheels/9c/fb/12/2c2371bd134a8ce5ad854b5b5eb8d4ebf37b1e60bc31c182aa Building wheel for pyOpenSSL (setup.py) . error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-8wdgl596/pyOpenSSL/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-8wdgl596/pyOpenSSL/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 /tmp/pip-wheel-fcirrlto cwd: /tmp/pip-install-8wdgl596/pyOpenSSL/ Complete output (36 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/OpenSSL copying OpenSSL/init.py -> build/lib.linux-x86_64-3.8/OpenSSL copying OpenSSL/tsafe.py -> build/lib.linux-x86_64-3.8/OpenSSL copying OpenSSL/version.py -> build/lib.linux-x86_64-3.8/OpenSSL creating build/lib.linux-x86_64-3.8/OpenSSL/test copying OpenSSL/test/init.py -> build/lib.linux-x86_64-3.8/OpenSSL/test copying OpenSSL/test/util.py -> build/lib.linux-x86_64-3.8/OpenSSL/test copying OpenSSL/test/test_crypto.py -> build/lib.linux-x86_64-3.8/OpenSSL/test copying OpenSSL/test/test_rand.py -> build/lib.linux-x86_64-3.8/OpenSSL/test copying OpenSSL/test/test_ssl.py -> build/lib.linux-x86_64-3.8/OpenSSL/test running build_ext building ‘OpenSSL.crypto’ extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/OpenSSL creating build/temp.linux-x86_64-3.8/OpenSSL/crypto x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c OpenSSL/crypto/crypto.c -o build/temp.linux-x86_64-3.8/OpenSSL/crypto/crypto.o OpenSSL/crypto/crypto.c: In function ‘crypto_sign’: OpenSSL/crypto/crypto.c:626:16: error: storage size of ‘md_ctx’ isn’t known 626 | EVP_MD_CTX md_ctx; | ^
  6. ImportError: No module named twisted.internet
  7. 7 Answers 7
  8. ImportError: No module named twisted
  9. 5 Answers 5
  10. ImportError: No module named jsonschema.exceptions #13
  11. Comments
  12. Euphorbium commented Apr 5, 2014
  13. rokcarl commented Apr 5, 2014
  14. dyerrington commented Apr 6, 2014
  15. dyerrington commented Apr 6, 2014
  16. Euphorbium commented Apr 6, 2014
  17. dyerrington commented Apr 6, 2014
  18. Euphorbium commented Apr 7, 2014
  19. trzarocks commented Apr 8, 2014

Issue with installing sslstrip #27

Comments

anonymous187 commented May 5, 2020

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:

anonymous187 commented May 5, 2020

adding to what i have posted earlier
i tried installing it using the below command:

pip3 install sslstrip
Collecting sslstrip
Downloading sslstrip-0.9.2.tar.gz (9.2 kB)
Collecting Twisted==13.1.0
Downloading Twisted-13.1.0.tar.bz2 (2.7 MB)
|████████████████████████████████| 2.7 MB 74 kB/s
Collecting pyOpenSSL==0.13.1
Downloading pyOpenSSL-0.13.1.tar.gz (254 kB)
|████████████████████████████████| 254 kB 135 kB/s
Requirement already satisfied: zope.interface>=3.6.0 in /usr/lib/python3/dist-packages (from Twisted==13.1.0->sslstrip) (4.7.1)
Building wheels for collected packages: sslstrip, Twisted, pyOpenSSL
Building wheel for sslstrip (setup.py) . done
Created wheel for sslstrip: filename=sslstrip-0.9.2-py3-none-any.whl size=14796 sha256=b5c3a7e8ae8768510e5cab995b0387523d48c55d14bee307c1c3730c45a37ef3
Stored in directory: /root/.cache/pip/wheels/fc/9d/90/1e5bc8d868e08c73037090addb2a01cc7b8444151828b5d7fa
Building wheel for Twisted (setup.py) . done
Created wheel for Twisted: filename=Twisted-13.1.0-cp38-cp38-linux_x86_64.whl size=2920570 sha256=735c6c41bc7f0e6a0969ff28db00af15916a87b14d57ddfebcaf61332402a6d9
Stored in directory: /root/.cache/pip/wheels/9c/fb/12/2c2371bd134a8ce5ad854b5b5eb8d4ebf37b1e60bc31c182aa
Building wheel for pyOpenSSL (setup.py) . error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-8wdgl596/pyOpenSSL/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-8wdgl596/pyOpenSSL/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 /tmp/pip-wheel-fcirrlto
cwd: /tmp/pip-install-8wdgl596/pyOpenSSL/
Complete output (36 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/OpenSSL
copying OpenSSL/init.py -> build/lib.linux-x86_64-3.8/OpenSSL
copying OpenSSL/tsafe.py -> build/lib.linux-x86_64-3.8/OpenSSL
copying OpenSSL/version.py -> build/lib.linux-x86_64-3.8/OpenSSL
creating build/lib.linux-x86_64-3.8/OpenSSL/test
copying OpenSSL/test/init.py -> build/lib.linux-x86_64-3.8/OpenSSL/test
copying OpenSSL/test/util.py -> build/lib.linux-x86_64-3.8/OpenSSL/test
copying OpenSSL/test/test_crypto.py -> build/lib.linux-x86_64-3.8/OpenSSL/test
copying OpenSSL/test/test_rand.py -> build/lib.linux-x86_64-3.8/OpenSSL/test
copying OpenSSL/test/test_ssl.py -> build/lib.linux-x86_64-3.8/OpenSSL/test
running build_ext
building ‘OpenSSL.crypto’ extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/OpenSSL
creating build/temp.linux-x86_64-3.8/OpenSSL/crypto
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c OpenSSL/crypto/crypto.c -o build/temp.linux-x86_64-3.8/OpenSSL/crypto/crypto.o
OpenSSL/crypto/crypto.c: In function ‘crypto_sign’:
OpenSSL/crypto/crypto.c:626:16: error: storage size of ‘md_ctx’ isn’t known
626 | EVP_MD_CTX md_ctx;
| ^

OpenSSL/crypto/crypto.c:626:16: warning: unused variable ‘md_ctx’ [-Wunused-variable]
OpenSSL/crypto/crypto.c: In function ‘crypto_verify’:
OpenSSL/crypto/crypto.c:673:16: error: storage size of ‘md_ctx’ isn’t known
673 | EVP_MD_CTX md_ctx;
| ^

Читайте также:  Качественные темы для windows 10

OpenSSL/crypto/crypto.c:673:16: warning: unused variable ‘md_ctx’ [-Wunused-variable]
At top level:
OpenSSL/crypto/crypto.c:743:13: warning: ‘locking_function’ defined but not used [-Wunused-function]
743 | static void locking_function(int mode, int n, const char * file, int line) <
| ^

error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Источник

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:

sudo apt-get install python-twisted

Then, I created a sample program using Echo Server code shown here

Here is the code

I try to run this code using this command:

Can anyone help me with how I can debug why my twisted package is not being picked up by Python installation?

7 Answers 7

If you use pip just try:

The same works with w3lib and lxml.

On some *nix systems this might give you a permission error. If that happens, try:

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.

Источник

ImportError: No module named twisted

I’m pretty new to python and twisted and I tried to run a simple twisted script but failed.

MacOX 10.7.2 + Python 2.7.1 + Twisted 11.0.0 + eclipse + PyDev

The script called test.py:

I tried to run it in the terminal and everything works fine.

Читайте также:  Windows kdfx reborn full

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:

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 🙂

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.

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:

  1. 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.
  2. Go to Aptana-preferences-PyDev-Interpreter-Python
  3. 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.

You need to install incremental before 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 jsonschema.exceptions #13

Comments

Euphorbium commented Apr 5, 2014

After correct installation, when I try to run

Traceback (most recent call last):
File «/usr/local/bin/twistd», line 14, in
run()
File «/usr/local/lib/python2.7/dist-packages/twisted/scripts/twistd.py», line 27, in run
app.run(runApp, ServerOptions)
File «/usr/local/lib/python2.7/dist-packages/twisted/application/app.py», line 642, in run
runApp(config)
File «/usr/local/lib/python2.7/dist-packages/twisted/scripts/twistd.py», line 23, in runApp
_SomeApplicationRunner(config).run()
File «/usr/local/lib/python2.7/dist-packages/twisted/application/app.py», line 376, in run
self.application = self.createOrGetApplication()
File «/usr/local/lib/python2.7/dist-packages/twisted/application/app.py», line 436, in createOrGetApplication
ser = plg.makeService(self.config.subOptions)
File «/home/euphorbium/Projects/mtg/scraper/portia-master/slyd/slyd/tap.py», line 55, in makeService
root = create_root(config)
File «/home/euphorbium/Projects/mtg/scraper/portia-master/slyd/slyd/tap.py», line 27, in create_root
from slyd.crawlerspec import (CrawlerSpecManager,
File «/home/euphorbium/Projects/mtg/scraper/portia-master/slyd/slyd/crawlerspec.py», line 12, in
from jsonschema.exceptions import ValidationError
ImportError: No module named jsonschema.exceptions

The text was updated successfully, but these errors were encountered:

Читайте также:  Как запустить windows aero

rokcarl commented Apr 5, 2014

Thank you, I thought I was alone! I spent almost my entire morning trying to get this thing up and running on my Mac. I think I got past this somehow, don’t remember how anymore cause I’ve tried a million things.

dyerrington commented Apr 6, 2014

I was able to get past this with

I’ve run into a whole lot of other problems on OSX attempting to set this up. The next thing on the list is:

dyerrington commented Apr 6, 2014

After this, I ran into another problem with the compiler conflicting in my virtualenv setup. I was able to fix this using this command:

Euphorbium commented Apr 6, 2014

jsonschema is installed in my setup, it would have been too easy, if it was not installed. I am not working on a Mac.

dyerrington commented Apr 6, 2014

@Euphorbium, the message traces back to

To me, it seems that the features in jsonschema the authors programmed against don’t match the features in your currently installed instance of jsonschema. The first time I tried to install portia, I had all sorts of weird things like this popping even with currently installed versions of the prerequisite modules.

After much whiney internal dialog in my head, I decided to setup virtualenv and install everything within virtualenv. Everything went super smooth. Are you using virtualenv? I used these directions:

The hackercodex directions seem fairly agnostic but perhaps if you’re using a flavor of linux there’s an easy apt-get-like package for it? It was actually surprisingly easy to install.

Euphorbium commented Apr 7, 2014

I have found what is wrong here. Somebody wrote requirements.txt by hand and not by pip freeze > requirements.txt, therefore versions of the required libraries are not specified. Somebody that has this thing working, please post the results of pip freeze here, and it should solve this problem for everyone.

trzarocks commented Apr 8, 2014

This is the first time I’ve ever done anything with git or python, the only thing I’ve programmed is an Arduino and some web scripting basics. So I’m probably not the best to answer the question. But I did get it working by looking for clues. The gist of it, I had a brand new ubuntu server vm, and I needed to install jsonschema and numpy, in addition to what was documented here. I might have also had to apt-get some python stuff, too. but tbh i just kept hammering away and didn’t really document anything. sudo was definitely a part of the solution, as well. Things weren’t getting written properly without it. So I’ve got it web accessible, but I’m stuck at trying to automate a scrape. Does anybody know if there are more resources than the youtube vid?

Источник

Оцените статью