cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2312
Views
5
Helpful
5
Replies

Issues installing via pip.

wdismuke
Cisco Employee
Cisco Employee

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'

1 Accepted Solution

Accepted Solutions

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

View solution in original post

5 Replies 5

Omar Santos
Cisco Employee
Cisco Employee

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?

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

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

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?

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.