fuse-python with OSXFUSE

983 views
Skip to first unread message

Tom Yarrish

unread,
Feb 23, 2012, 3:08:38 PM2/23/12
to osxfus...@googlegroups.com
Hello,
I have a new machine with OSX Lion and I've installed OSXFUSE without any issues.  But I need to install fuse-python in order to use libewf to mount some image files.  However when I go to install fuse-python I'm getting the following error:

pkg-config could not find fuse:
you might need to adjust PKG_CONFIG_PATH or your 
FUSE installation is very old (older than 2.1-pre1)
Traceback (most recent call last):
  File "setup.py", line 69, in <module>
    iflags = [x[2:] for x in cflags.split() if x[0:2] == '-I']
NameError: name 'cflags' is not defined

Now as far as I can remember I installed OSXFUSE with the legacy MacFuse support, but I was wondering if anyone else has installed fuse-python.

I've installed it on other machines (pre-Lion) with MacFUSE without any issues, so I know it works with MacFUSE at least.

Thanks ahead of time...
Tom

Benjamin Fleischer

unread,
Feb 24, 2012, 11:22:18 AM2/24/12
to osxfus...@googlegroups.com
Hi Tom,

Am 23.02.2012 um 21:08 schrieb Tom Yarrish:

> I have a new machine with OSX Lion and I've installed OSXFUSE without any issues. But I need to install fuse-python in order to use libewf to mount some image files. However when I go to install fuse-python I'm getting the following error:
>
> pkg-config could not find fuse:
> you might need to adjust PKG_CONFIG_PATH or your
> FUSE installation is very old (older than 2.1-pre1)
> Traceback (most recent call last):
> File "setup.py", line 69, in <module>
> iflags = [x[2:] for x in cflags.split() if x[0:2] == '-I']
> NameError: name 'cflags' is not defined

To build fuse-python with OSXFUSE run the following commands:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
sudo touch /usr/include/osreldate.h

and finally:

python setup.py build

After fuse-python has been built sucessfully the file /usr/include/osreldate.h can be removed:
sudo rm /usr/include/osreldate.h

This (osreldate.h) is a known issue and will be fixed in a future version of OSXFUSE.

> Now as far as I can remember I installed OSXFUSE with the legacy MacFuse support, but I was wondering if anyone else has installed fuse-python.

It should work fine without the "MacFUSE compatibility layer" installed but it does not hurt either :-)

Regards,
Benjamin

Tom Yarrish

unread,
Feb 24, 2012, 1:11:19 PM2/24/12
to osxfus...@googlegroups.com

To build fuse-python with OSXFUSE run the following commands:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
sudo touch /usr/include/osreldate.h

and finally:

python setup.py build

After fuse-python has been built sucessfully the file /usr/include/osreldate.h can be removed:
sudo rm /usr/include/osreldate.h

This (osreldate.h) is a known issue and will be fixed in a future version of OSXFUSE.


Regards,
Benjamin


Ok so that worked for python setup.py build, however when I go to do:

sudo python setup.py install

I get the following error:

pkg-config could not find fuse:
you might need to adjust PKG_CONFIG_PATH or your 
FUSE installation is very old (older than 2.1-pre1)
Traceback (most recent call last):
  File "setup.py", line 69, in <module>
    iflags = [x[2:] for x in cflags.split() if x[0:2] == '-I']
NameError: name 'cflags' is not defined

I tried running the export package again (even as root) and that didn't make a difference.

Thanks,
Tom


Benjamin Fleischer

unread,
Feb 25, 2012, 11:52:23 AM2/25/12
to osxfus...@googlegroups.com
Hi,

Am 24.02.2012 um 19:11 schrieb Tom Yarrish:

> Ok so that worked for python setup.py build, however when I go to do:
>
> sudo python setup.py install
>
> I get the following error:
>
> pkg-config could not find fuse:
> you might need to adjust PKG_CONFIG_PATH or your
> FUSE installation is very old (older than 2.1-pre1)
> Traceback (most recent call last):
> File "setup.py", line 69, in <module>
> iflags = [x[2:] for x in cflags.split() if x[0:2] == '-I']
> NameError: name 'cflags' is not defined
>
> I tried running the export package again (even as root) and that didn't make a difference.

Instead of running "sudo python setup.py install" do the following:

sudo PKG_CONFIG_PATH=/usr/local/lib/pkgconfig python setup.py install

The PKG_CONFIG_PATH variable does not survive sudo. That's why the call to pkg-config in setup.py fails.

Regards,
Benjamin

Tom Yarrish

unread,
Feb 25, 2012, 7:33:54 PM2/25/12
to osxfus...@googlegroups.com

Instead of running "sudo python setup.py install" do the following:

sudo PKG_CONFIG_PATH=/usr/local/lib/pkgconfig python setup.py install

The PKG_CONFIG_PATH variable does not survive sudo. That's why the call to pkg-config in setup.py fails.

Regards,
Benjamin


That worked.  Thank you so much for your help.

Tom 

rgenito

unread,
Mar 24, 2012, 11:54:23 PM3/24/12
to osxfus...@googlegroups.com
Benjamin's original instructions worked for me perfectly...so i was very happy :D

However, how on earth do you import this library with python? I've tried "import fusepython", "import fuse", etc... and no matter what i keep getting "ImportError: No module named _fuse". Then again, it is very likely I did not try every possibility. Any help would be greatly appreciated! For now, I will keep digging...

Tom Yarrish

unread,
Mar 26, 2012, 4:58:59 PM3/26/12
to osxfus...@googlegroups.com
I ended up not needing it.  I was able to do what I wanted to do with libewf directly (which was the original goal).

Tom
Reply all
Reply to author
Forward
0 new messages