pysqlite import error - opened on behalf of dmitris #161

Closed
andresriancho opened this Issue Mar 12, 2013 · 6 comments

Comments

Projects
None yet
3 participants
Owner

andresriancho commented Mar 12, 2013

dmitris said:

Currently I'm having a different problem when trying to run ./w3af_console:

$ ./w3af_console 
Your python installation needs the following modules to run w3af:
    sqlite3 

After installing any missing operating system packages, use pip to install the remaining modules:
    sudo pip install pysqlite 

but pysqlite is already installed with pip:

$ pip list | grep sqlite
pysqlite (2.6.3)

I noticed that you have to import from pysqlite2, not pysqlite - does it cause the error?


>>> import pysqlite
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pysqlite
>>> import pysqlite2
Owner

andresriancho commented Mar 12, 2013

The package that (at least until now) is required for installation is pysqlite but this package provides the sqlite3 module, which is the thing we use:

>>> import sqlite3
>>>

dmitris commented Mar 13, 2013

One of the Macs I have was able to start w3af_console even without pysqlite pip package - I think Python now has sqlite built-in, is the dependency really needed? I also try to uninstall it, and w3af_console starts fine.

For the other Mac, I had the following errors:

ImportError: dlopen(/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so, 2): Library not loaded: /usr/local/lib/libsqlite3.0.8.6.dylib
  Referenced from: /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so
  Reason: image not found

which is mentioned in mxcl/homebrew#17312 together with the solution that worked for me:

brew rm python
brew install python

(by the way, the built-in hinst from w3af mention Mac's port - but now I think the brew is the Mac package manager du jour :))

Please feel free to close the issue. Thanks.

Owner

andresriancho commented Mar 13, 2013

One of the Macs I have was able to start w3af_console even without pysqlite pip package - I think Python now has sqlite built-in, is the dependency really needed?

After your question I decided to look into this and found these two links. Where they explain that while sqlite3 is part of python starting with python 2.5 there are some linux distributions that split it into another package.

That's why and because I want to support as many platforms as possible, I'll leave the check that performs import sqlite3 and if it fails recommend installing pysqlite. If it doesn't fail, it's because the user already installed the dependency or it came with python. If it does fail, it's because one of the later did not happen and we require the user to install it.

Glad you were able to fix your issues. I certainly need a Mac to play with and make the installation much easier.

hxcxx commented Feb 28, 2014

your python installation needs the fallowing modules to run: esmre, clamd github git.util pybloomfilter phply nltk chardet pdfminer concurrent.futures lxml scapy.config guess_language cluster msgpack ntlm xdot

go to https://pypi.python.org/pypi and find module you need... example: clamd bithub git.util pybloomfilter

for module ESMRE go to https://pypi.python.org/pypi/esmre download file esmre-0.3.1.tar.gz
save in /root
open terminal run commands in order (without $) :
$ cd /root
$ ls
$ tar -zxvf esmre-0.3.1.tar.gz
$ cd esmre-0.3.1
$ python setup.py install
check the install:
$ cd test
$ python test_esm.py (will display the message OK)
$ python test_esmre.py
if message OK in 2 tests,open w3af

PS: for other modules i belive the process is the same,
find in https://pypi.python.org/pypi the module you need
for example: clamd,github,git.util,pybloomfilter,,,,
i belive the process of installation is the same... tested in kali linux. for other OS may be the same process,adapted commands for your OS.

sorry my bad english :(

hxcxx

Owner

andresriancho commented Feb 28, 2014

@hxcxx : if you know the module name, instead of doing all those manual steps just do pip install modulename

hxcxx commented Feb 28, 2014

@andresriancho : I tried in kali linux , but this command does not work here (pip install modulename)
if anyone gets this way is much much easier,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment