09-20-2016 10:56 AM
As I'm originally a network guy, I'm bringing myself up to speed on this whole process. Usually this involves hitting a wall and then googling my way through it. I've come up against one that I can't seem to find the answers to, though. After installing a bunch of dev packages (libxml2-dev, libxslt1-dev, python-dev, and zlib1g-dev) I'm finally getting farther into installing the openVulnQuery tools via pip.
pip install openVulnQuery
It's still failing, however. Issuing that command:
1. Collects (successfully) openVulnQuery, argparse, lxml, and PrettyTable.
2, Successfully builds lxml
3. Fails in a spectacular sea of red text to "[Install] collected packages: argparse, lxml, PrettyTable, openVulnQuery"
Anyone have thoughts about what I'm missing?
Exact output of the command below:
Collecting openVulnQuery
Requirement already satisfied (use --upgrade to upgrade): requests==2.10.0 in /usr/local/lib/python2.7/dist-packages (from openVulnQuery)
Collecting argparse==1.4.0 (from openVulnQuery)
Using cached argparse-1.4.0-py2.py3-none-any.whl
Collecting lxml==3.6.0 (from openVulnQuery)
Collecting PrettyTable==0.7.2 (from openVulnQuery)
Installing collected packages: argparse, lxml, PrettyTable, openVulnQuery
Found existing installation: argparse 1.2.1
Not uninstalling argparse at /usr/lib/python2.7, as it is in the standard library.
Can't rollback argparse, nothing uninstalled.
Exception:
Traceback (most recent call last):
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/wdismukes/.local/lib/python2.7/site-packages/pip/wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/argparse.pyc'
Solved! Go to Solution.
09-20-2016 02:12 PM
Hello William,
I recommend using python's virtual environment. This is excellent tool to keep dependencies required by different project in separate places by creating python virtual environments for them.
$ pip install virtualenv [you might have to sudo install this but it is a trusted library]
Now, go to your project folder
$ cd project_folder
$ virtualenv venv (this is your name of virtual environment)
To activate the virtual environment
$ source venv/bin/activate
you will see (venv) added on your terminal. This means your virtual environment is active and you can install anything you want and it will be contained in that virtual environment without being installed into your local machine.
$pip install openVunQuery
You can find more information about it on this link. Virtual Environments — The Hitchhiker's Guide to Python
09-20-2016 11:28 AM
Hi William!
I see the following:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/argparse.pyc'
Where you using sudo pip install openVulnQuery?
09-20-2016 12:16 PM
I've tried both, but when I was looking around it seemed that sudo'ing pip wasn't the correct way to go about it. Should I be sudo'ing it? I can post the content of those errors too.
The documentation on the PSIRT site doesn't say to sudo. It just says:
pip install openVulnQuery
09-20-2016 02:12 PM
Hello William,
I recommend using python's virtual environment. This is excellent tool to keep dependencies required by different project in separate places by creating python virtual environments for them.
$ pip install virtualenv [you might have to sudo install this but it is a trusted library]
Now, go to your project folder
$ cd project_folder
$ virtualenv venv (this is your name of virtual environment)
To activate the virtual environment
$ source venv/bin/activate
you will see (venv) added on your terminal. This means your virtual environment is active and you can install anything you want and it will be contained in that virtual environment without being installed into your local machine.
$pip install openVunQuery
You can find more information about it on this link. Virtual Environments — The Hitchhiker's Guide to Python
09-21-2016 11:59 AM
Worked like a charm, thanks. Am I going to run into any issues trying to export the data I'm pulling inside this venve into other processes?
09-26-2016 10:11 PM
I think there shouldn't be any such problem. Virtual Environment lets you setup all the requirements you need for a project inside a folder and it shouldn't affect other independent process running alongside. If you encounter any problem. Please Let us know, we will be happy to help.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide