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

ModuleNotFoundError #7

Open
TheLittleH4ck3r opened this issue Mar 31, 2022 · 8 comments
Open

ModuleNotFoundError #7

TheLittleH4ck3r opened this issue Mar 31, 2022 · 8 comments

Comments

@TheLittleH4ck3r
Copy link

┌──(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

@Elsfa7-110
Copy link

+1

@cckuailong
Copy link
Owner

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

@TheLittleH4ck3r
Copy link
Author

not work

@okadwin
Copy link

okadwin commented Apr 1, 2022

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
Copy link

okadwin commented Apr 1, 2022

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.

@cckuailong
Copy link
Owner

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

@sampl3x
Copy link

sampl3x commented May 28, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@cckuailong @sampl3x @Elsfa7-110 @okadwin @TheLittleH4ck3r and others