theHarvester:无法导入模块

theHarvester:无法导入模块

我正在尝试安装并运行收割者。我正在运行 Ubuntu 16.04 LTS。

我默认的python3是3.5.2版本。 theHarvester需要Python3.6+,所以我安装了Python3.6和Python3.7 sudo apt install python3.6 pthon3.7。 我的pip3是8.1.1版本(似乎是针对python3.5的)。

我已经运行pip3 install -r requirements.txt安装依赖项。当我这样做时python3.6 theHarvester.py,我收到以下错误:

Traceback (most recent call last):
  File "theHarvester.py", line 10, in <module>
    from theHarvester import __main__
  File "/home/johnzhau/myTools/theHarvester/theHarvester/__init__.py", line 1, in <module>
    from gevent import monkey as curious_george
ModuleNotFoundError: No module named 'gevent'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "theHarvester.py", line 10, in <module>
    from theHarvester import __main__
  File "/home/johnzhau/myTools/theHarvester/theHarvester/__init__.py", line 1, in <module>
    from gevent import monkey as curious_george
ModuleNotFoundError: No module named 'gevent'

显然,使用 pip3 v8.1.1 安装依赖项不允许 python3.6 使用依赖项。我应该如何修复它,以便我可以为 python 3.6+ 安装依赖项或让 python3.6 读取 pip3 v8.1.1 (python3.5) 的依赖项?

答案1

收割者安装应该相当容易,试试这个

pip3 install gevent

至于 apt_pgk 尝试这个

sudo apt-get install --reinstall python3-apt

相关内容