You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bloodhound.apache.org by Ted <r6...@gmail.com> on 2015/02/07 00:20:16 UTC

blood hound & mysql doesn't work with the install script

I was trying to follow the install instructions for using blood hound and
MySql but I ran into a problem where it thinks I don't have mysql installed.

I'm running :

python ../../apache-bloodhound-0.8/installer/bloodhound_setup.py
--environments_directory=`pwd` --default-product-prefix=DEF

and the result is it tells me :

MySQLdb needs to be installed to initialise a mysql db

I should declare upfront that I'm actually using mariadb instead of mysql,
but most libraries so far that I've used don't seem to know it's any
different...
I went and modified bhsetup/bloodhound_setup.py to printed the exception at
around line 48 on the "import MySQLdb as mysqldb" and the exception was
"No module named MySQLdb".

>From what I read it means I need to install MySql-Python, the thing is, I
have that installed.

> rpm -qa | grep -i mysql | grep -i python
mysql-connector-python3-1.1.6-3.fc21.noarch
MySQL-python-1.2.3-13.fc21.x86_64
python-storm-mysql-0.20-4.fc21.x86_64
mysql-connector-python-1.1.6-3.fc21.noarch
MySQL-python-debug-1.2.3-13.fc21.x86_64

I'm using fedora 21, x86_64, mariaDb, Python 2.7.8

I'm not sure what else to do to debug this further, any ideas?
-- 
Ted.

Re: blood hound & mysql doesn't work with the install script

Posted by Patrick West <we...@rpi.edu>.
Along these same lines, we’re using bloodhound here at RPI in one of the labs (Tetherless World Constellation) and are creating a docker instance. So we’ll have bloodhound installed in a docker container and be able to spin up a new one anytime we want. It’ll be part of our Source Code Management virtual environment (not python virtual environment but xenserver virtual machines.)

And one of the things we’ll want to do is use mysql (in a separate docker container).

-- Patrick West 
---- Principal Software Engineer
---- Tetherless World Constellation 
---- Rensselaer Polytechnic Institute 
---- westp@rpi.edu 


On Feb 9, 2015, at 12:12 PM, Ryan J Ollos <rj...@apache.org> wrote:

> On Mon, Feb 9, 2015 at 10:46 AM, Branko Čibej <br...@wandisco.com> wrote:
> On 09.02.2015 19:28, Ryan J Ollos wrote:
>> On Sun, Feb 8, 2015 at 11:21 PM, Branko Čibej <br...@wandisco.com> wrote:
>> On 09.02.2015 07:27, Ryan J Ollos wrote:
>>> On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6...@gmail.com> wrote:
>>> nope... I'm not a python developer so I don't know where it actually looks for these.
>>> 
>>> (bhenv)[~/data/apps/bhenv]python
>>> Python 2.7.8 (default, Nov 10 2014, 08:19:18) 
>>> [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import MySQLdb
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>> ImportError: No module named MySQLdb
>>> >>> 
>>> 
>>>  It seems that MySQLdb is not being inherited from the global site-packages directory. You could try "easy_install MySQLdb", using easy_install from your virtualenv.
>> 
>> Virtualenv defaults to --no-site-packages, so that may well be the case.
>> 
>> -- Brane
>> 
>> I didn't realize the install instructions had been edited to remove the "--system-site-packages" option when creating the virtualenv.
>> https://issues.apache.org/bloodhound/wiki/BloodhoundInstall?action=diff&version=31&old_version=30
>> 
>> In absence of additional modifications to the install steps, I believe the following is required:
>> virtualenv --system-site-packages /opt/bloodhound/bhenv 
> 
> I'm sort of not thrilled by the idea that you'd create a virtual environment for bloodhound, but then expect certain packages to be inherited from the system installation. It makes marginal sense for Linux distros, where getting your MySQL bindings is a 'yum' or 'rpm' or 'apt-get' away, but what about other platforms?
> 
> -- Brane
> 
> I agree that it doesn't make a lot of sense. I tried to modify the steps at some point to remove the need for the --system-site-packages option and ran into issues. I don't recall what the issues were and I'm unable to find the discussion. I'll need to run through the install steps in full to refresh my memory.
> 
> - Ryan


Re: blood hound & mysql doesn't work with the install script

Posted by Ryan J Ollos <rj...@apache.org>.
On Mon, Feb 9, 2015 at 10:46 AM, Branko Čibej <br...@wandisco.com> wrote:

>  On 09.02.2015 19:28, Ryan J Ollos wrote:
>
>  On Sun, Feb 8, 2015 at 11:21 PM, Branko Čibej <br...@wandisco.com> wrote:
>
>>   On 09.02.2015 07:27, Ryan J Ollos wrote:
>>
>>  On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6...@gmail.com> wrote:
>>
>>> nope... I'm not a python developer so I don't know where it actually
>>> looks for these.
>>>
>>> (bhenv)[~/data/apps/bhenv]python
>>> Python 2.7.8 (default, Nov 10 2014, 08:19:18)
>>> [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import MySQLdb
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>> ImportError: No module named MySQLdb
>>> >>>
>>>
>>
>>   It seems that MySQLdb is not being inherited from the global
>> site-packages directory. You could try "easy_install MySQLdb", using
>> easy_install from your virtualenv.
>>
>>
>>  Virtualenv defaults to --no-site-packages, so that may well be the case.
>>
>> -- Brane
>>
>
>  I didn't realize the install instructions had been edited to remove the
> "--system-site-packages" option when creating the virtualenv.
>
> https://issues.apache.org/bloodhound/wiki/BloodhoundInstall?action=diff&version=31&old_version=30
>
>  In absence of additional modifications to the install steps, I believe
> the following is required:
> virtualenv --system-site-packages /opt/bloodhound/bhenv
>
>
> I'm sort of not thrilled by the idea that you'd create a virtual
> environment for bloodhound, but then expect certain packages to be
> inherited from the system installation. It makes marginal sense for Linux
> distros, where getting your MySQL bindings is a 'yum' or 'rpm' or 'apt-get'
> away, but what about other platforms?
>
> -- Brane
>

I agree that it doesn't make a lot of sense. I tried to modify the steps at
some point to remove the need for the --system-site-packages option and ran
into issues. I don't recall what the issues were and I'm unable to find the
discussion. I'll need to run through the install steps in full to refresh
my memory.

- Ryan

Re: blood hound & mysql doesn't work with the install script

Posted by Branko Čibej <br...@wandisco.com>.
On 09.02.2015 19:28, Ryan J Ollos wrote:
> On Sun, Feb 8, 2015 at 11:21 PM, Branko Čibej <brane@wandisco.com
> <ma...@wandisco.com>> wrote:
>
>     On 09.02.2015 07:27, Ryan J Ollos wrote:
>>     On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6squeegee@gmail.com
>>     <ma...@gmail.com>> wrote:
>>
>>         nope... I'm not a python developer so I don't know where it
>>         actually looks for these.
>>
>>         (bhenv)[~/data/apps/bhenv]python
>>         Python 2.7.8 (default, Nov 10 2014, 08:19:18)
>>         [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
>>         Type "help", "copyright", "credits" or "license" for more
>>         information.
>>         >>> import MySQLdb
>>         Traceback (most recent call last):
>>           File "<stdin>", line 1, in <module>
>>         ImportError: No module named MySQLdb
>>         >>>
>>
>>
>>      It seems that MySQLdb is not being inherited from the global
>>     site-packages directory. You could try "easy_install MySQLdb",
>>     using easy_install from your virtualenv.
>
>     Virtualenv defaults to --no-site-packages, so that may well be the
>     case.
>
>     -- Brane
>
>
> I didn't realize the install instructions had been edited to remove
> the "--system-site-packages" option when creating the virtualenv.
> https://issues.apache.org/bloodhound/wiki/BloodhoundInstall?action=diff&version=31&old_version=30
>
> In absence of additional modifications to the install steps, I believe
> the following is required:
> virtualenv --system-site-packages /opt/bloodhound/bhenv

I'm sort of not thrilled by the idea that you'd create a virtual
environment for bloodhound, but then expect certain packages to be
inherited from the system installation. It makes marginal sense for
Linux distros, where getting your MySQL bindings is a 'yum' or 'rpm' or
'apt-get' away, but what about other platforms?

-- Brane

Re: blood hound & mysql doesn't work with the install script

Posted by Ryan J Ollos <rj...@apache.org>.
On Mon, Feb 9, 2015 at 1:36 PM, Ted <r6...@gmail.com> wrote:

> virtualenv --system-site-packages
>
> worked, thanks.
>

Thanks, we'll consider that an interim solution and aim to improve the
install steps.

Re: blood hound & mysql doesn't work with the install script

Posted by Ted <r6...@gmail.com>.
virtualenv --system-site-packages

worked, thanks.

On Mon, Feb 9, 2015 at 10:28 AM, Ryan J Ollos <rj...@apache.org> wrote:

> On Sun, Feb 8, 2015 at 11:21 PM, Branko Čibej <br...@wandisco.com> wrote:
>
>>  On 09.02.2015 07:27, Ryan J Ollos wrote:
>>
>>  On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6...@gmail.com> wrote:
>>
>>> nope... I'm not a python developer so I don't know where it actually
>>> looks for these.
>>>
>>> (bhenv)[~/data/apps/bhenv]python
>>> Python 2.7.8 (default, Nov 10 2014, 08:19:18)
>>> [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import MySQLdb
>>> Traceback (most recent call last):
>>>   File "<stdin>", line 1, in <module>
>>> ImportError: No module named MySQLdb
>>> >>>
>>>
>>
>>   It seems that MySQLdb is not being inherited from the global
>> site-packages directory. You could try "easy_install MySQLdb", using
>> easy_install from your virtualenv.
>>
>>
>> Virtualenv defaults to --no-site-packages, so that may well be the case.
>>
>> -- Brane
>>
>
> I didn't realize the install instructions had been edited to remove the
> "--system-site-packages" option when creating the virtualenv.
>
> https://issues.apache.org/bloodhound/wiki/BloodhoundInstall?action=diff&version=31&old_version=30
>
> In absence of additional modifications to the install steps, I believe the
> following is required:
> virtualenv --system-site-packages /opt/bloodhound/bhenv
>
>


-- 
Ted.

Re: blood hound & mysql doesn't work with the install script

Posted by Ryan J Ollos <rj...@apache.org>.
On Sun, Feb 8, 2015 at 11:21 PM, Branko Čibej <br...@wandisco.com> wrote:

>  On 09.02.2015 07:27, Ryan J Ollos wrote:
>
>  On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6...@gmail.com> wrote:
>
>> nope... I'm not a python developer so I don't know where it actually
>> looks for these.
>>
>> (bhenv)[~/data/apps/bhenv]python
>> Python 2.7.8 (default, Nov 10 2014, 08:19:18)
>> [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import MySQLdb
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> ImportError: No module named MySQLdb
>> >>>
>>
>
>   It seems that MySQLdb is not being inherited from the global
> site-packages directory. You could try "easy_install MySQLdb", using
> easy_install from your virtualenv.
>
>
> Virtualenv defaults to --no-site-packages, so that may well be the case.
>
> -- Brane
>

I didn't realize the install instructions had been edited to remove the
"--system-site-packages" option when creating the virtualenv.
https://issues.apache.org/bloodhound/wiki/BloodhoundInstall?action=diff&version=31&old_version=30

In absence of additional modifications to the install steps, I believe the
following is required:
virtualenv --system-site-packages /opt/bloodhound/bhenv

Re: blood hound & mysql doesn't work with the install script

Posted by Branko Čibej <br...@wandisco.com>.
On 09.02.2015 07:27, Ryan J Ollos wrote:
> On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6squeegee@gmail.com
> <ma...@gmail.com>> wrote:
>
>     nope... I'm not a python developer so I don't know where it
>     actually looks for these.
>
>     (bhenv)[~/data/apps/bhenv]python
>     Python 2.7.8 (default, Nov 10 2014, 08:19:18)
>     [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> import MySQLdb
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     ImportError: No module named MySQLdb
>     >>>
>
>
>  It seems that MySQLdb is not being inherited from the global
> site-packages directory. You could try "easy_install MySQLdb", using
> easy_install from your virtualenv.

Virtualenv defaults to --no-site-packages, so that may well be the case.

-- Brane

Re: blood hound & mysql doesn't work with the install script

Posted by Ryan J Ollos <rj...@apache.org>.
On Fri, Feb 6, 2015 at 7:52 PM, Ted <r6...@gmail.com> wrote:

> nope... I'm not a python developer so I don't know where it actually looks
> for these.
>
> (bhenv)[~/data/apps/bhenv]python
> Python 2.7.8 (default, Nov 10 2014, 08:19:18)
> [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import MySQLdb
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named MySQLdb
> >>>
>

 It seems that MySQLdb is not being inherited from the global site-packages
directory. You could try "easy_install MySQLdb", using easy_install from
your virtualenv.

Re: blood hound & mysql doesn't work with the install script

Posted by Ted <r6...@gmail.com>.
nope... I'm not a python developer so I don't know where it actually looks
for these.

(bhenv)[~/data/apps/bhenv]python
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named MySQLdb
>>>


On Fri, Feb 6, 2015 at 3:24 PM, Ryan J Ollos <rj...@apache.org> wrote:

>
>
> On Fri, Feb 6, 2015 at 3:20 PM, Ted <r6...@gmail.com> wrote:
>
>> I was trying to follow the install instructions for using blood hound and
>> MySql but I ran into a problem where it thinks I don't have mysql installed.
>>
>> I'm running :
>>
>> python ../../apache-bloodhound-0.8/installer/bloodhound_setup.py
>> --environments_directory=`pwd` --default-product-prefix=DEF
>>
>> and the result is it tells me :
>>
>> MySQLdb needs to be installed to initialise a mysql db
>>
>> I should declare upfront that I'm actually using mariadb instead of
>> mysql, but most libraries so far that I've used don't seem to know it's any
>> different...
>> I went and modified bhsetup/bloodhound_setup.py to printed the exception
>> at around line 48 on the "import MySQLdb as mysqldb" and the exception was
>> "No module named MySQLdb".
>>
>> From what I read it means I need to install MySql-Python, the thing is, I
>> have that installed.
>>
>> > rpm -qa | grep -i mysql | grep -i python
>> mysql-connector-python3-1.1.6-3.fc21.noarch
>> MySQL-python-1.2.3-13.fc21.x86_64
>> python-storm-mysql-0.20-4.fc21.x86_64
>> mysql-connector-python-1.1.6-3.fc21.noarch
>> MySQL-python-debug-1.2.3-13.fc21.x86_64
>>
>> I'm using fedora 21, x86_64, mariaDb, Python 2.7.8
>>
>> I'm not sure what else to do to debug this further, any ideas?
>> --
>> Ted.
>>
>
> Next step would be to start python an interactive Python shell *in your
> virtualenv* and see if you can successfully "import MySQLdb"
>
>


-- 
Ted.

Re: blood hound & mysql doesn't work with the install script

Posted by Ryan J Ollos <rj...@apache.org>.
On Fri, Feb 6, 2015 at 3:20 PM, Ted <r6...@gmail.com> wrote:

> I was trying to follow the install instructions for using blood hound and
> MySql but I ran into a problem where it thinks I don't have mysql installed.
>
> I'm running :
>
> python ../../apache-bloodhound-0.8/installer/bloodhound_setup.py
> --environments_directory=`pwd` --default-product-prefix=DEF
>
> and the result is it tells me :
>
> MySQLdb needs to be installed to initialise a mysql db
>
> I should declare upfront that I'm actually using mariadb instead of mysql,
> but most libraries so far that I've used don't seem to know it's any
> different...
> I went and modified bhsetup/bloodhound_setup.py to printed the exception
> at around line 48 on the "import MySQLdb as mysqldb" and the exception was
> "No module named MySQLdb".
>
> From what I read it means I need to install MySql-Python, the thing is, I
> have that installed.
>
> > rpm -qa | grep -i mysql | grep -i python
> mysql-connector-python3-1.1.6-3.fc21.noarch
> MySQL-python-1.2.3-13.fc21.x86_64
> python-storm-mysql-0.20-4.fc21.x86_64
> mysql-connector-python-1.1.6-3.fc21.noarch
> MySQL-python-debug-1.2.3-13.fc21.x86_64
>
> I'm using fedora 21, x86_64, mariaDb, Python 2.7.8
>
> I'm not sure what else to do to debug this further, any ideas?
> --
> Ted.
>

Next step would be to start python an interactive Python shell *in your
virtualenv* and see if you can successfully "import MySQLdb"