ImportError: cannot import name 'SecureHeaders' from 'secure'
See original GitHub issue**Please provide a description of the issue and any relevant error messages.
I follow these instructions to install spiderfoot on Debian 10 https://www.howtoforge.com/how-to-install-spiderfoot-on-ubuntu-20-04/
However, whenever I run:
python3 sf.py --help
I get:
# python3 sf.py --help
Traceback (most recent call last):
File "sf.py", line 32, in <module>
from sfwebui import SpiderFootWebUi
File "/root/python-environments/spiderfoot-3.3/sfwebui.py", line 27, in <module>
from secure import SecureHeaders
ImportError: cannot import name 'SecureHeaders' from 'secure' (/root/python-environments/spiderfoot-env/lib/python3.7/site-packages/secure/__init__.py)
**What version of Python are you using?
I have python 2.7 and 3.7 installed. I am using python 3.7 in a virtual environment to install.
My Steps:
#pip3 install --upgrade pip
#pip3 install wheel
#wget https://github.com/smicallef/spiderfoot/archive/v3.3.tar.gz
#tar -xvzf v3.3.tar.gz
#cd spiderfoot-3.3
#pip3 install -r requirements.txt
#python3 sf.py --help
ERROR (see above)
I tried with secure-0.2.1
in the requirements.txt I tried again after editing requirements.txt to use secure-0.3.0
, but same error
**What version of SpiderFoot are you using (stable release or Git master
branch)?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
cannot import name 'SecureHeaders' from 'secure'
ImportError : cannot import name 'SecureHeaders' from 'secure'
Read more >ImportError: cannot import name 'secure_filename' - ...
For Werkzeug version 2.1.2, just import secure_filename as: from werkzeug.utils import secure_filename.
Read more >Python Friday #43: Add Security Headers to Your Flask ...
Today we look at a first simple measure to add security headers. This post is part of my journey to ... from secure...
Read more >[Solved] ImportError: Cannot Import Name - Python Pool
ImportError : Cannot Import Name: In this article, we will see what are the reasons for importerror cannot import name and find its...
Read more >How to Download, Install, and Setup Tensorflow on ...
Invicti Web Application Security Scanner - the only solution that delivers ... “ImportError: DLL load failed: The specified module could not be found.“:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey hey, thanks for the help. Turns out that the requirements.txt that I downloaded with:
wget https://github.com/smicallef/spiderfoot/archive/v3.3.tar.gz
is simply incorrect.Just before before I ran:
pip3 install -r requirements.txt
I first made a backup of the requirements.txt -> requirements.txt.bak Then, I made a new requirements.txt file and copy & pasted your content from:
https://github.com/smicallef/spiderfoot/blob/master/requirements.txt
Sure, enough I was able to complete the install without any further problems.FYI I ran a quick diff check of requirements.txt (yours) and requirements.txt.bak (the original downloaded in the tar.gz), it showed several lines are different and were causing my headache:
The installation went smoothly, so we can close this issued as solved. A new issue arose when trying to run spiderfoot on my prod server, but I will research a bit, and open a new issue, if I can’t crack it.
thanks
#On Ubuntu 20.10 The tool works After
pip3 install secure==0.2.1
Andpip3 install networkx==2.5
This resolve both :
cannot import name 'nx' from 'networkx'
cannot import name 'SecureHeaders' from 'secure'