pocsploit icon indicating copy to clipboard operation
pocsploit copied to clipboard

ModuleNotFoundError

Open TheLittleH4ck3r opened this issue 2 years ago • 8 comments

┌──(root💀kali)-[~/pocsploit] └─# python3 pocsploit.py -iS "https://testphp.vulnweb.com/" -r "modules/" -t 100 --poc Traceback (most recent call last): File "/root/pocsploit/pocsploit.py", line 3, in from lib.cli import main ModuleNotFoundError: No module named 'lib.cli'

How to fix it

TheLittleH4ck3r avatar Mar 31 '22 06:03 TheLittleH4ck3r

+1

Elsfa7-110 avatar Mar 31 '22 08:03 Elsfa7-110

I test it on kali, and it works well... image May be you can add this to pocsploit.py

import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
image

cckuailong avatar Mar 31 '22 08:03 cckuailong

not work

TheLittleH4ck3r avatar Mar 31 '22 13:03 TheLittleH4ck3r

I test it on kali, and it works well... image May be you can add this to pocsploit.py

import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
image

我在win7中使用绿色安装的pthon37也出现这个问题(绿色安装过程大概与https://www.cnblogs.com/hester/p/11321884.html 一致),但是将lib目录复制到python的Lib\site-packages目录下就可以了,python的Lib\site-packages目录是pip默认安装的位置,推测某些情况下python在import的时候可能无法在项目目录下查找,仅在pip安装目录查找,导致的这个问题。由于对python不是很了解,所以这个查找的具体机制不是很清楚,不知道怎么更优雅的解决,希望这个问题能够优雅的解决一下。

okadwin avatar Apr 01 '22 01:04 okadwin

not work

I found a way to solve the problem,You can copy the lib directory under the project root directory to the Lib or Lib\site-packages directory of pip, which may generally be under the python installation directory.

okadwin avatar Apr 01 '22 01:04 okadwin

It is commonly caused by the PYTHONPATH env. You can find the solution here. https://stackoverflow.com/questions/23417941/import-error-no-module-named-does-exist

image

cckuailong avatar Apr 01 '22 02:04 cckuailong

I got the same error: WARNING | lib.controller.loader:loadModule:45 - Failed modules: []

sampl3x avatar May 28 '22 05:05 sampl3x