Discussion:
func on Ubuntu?
Joel Krauska
2011-02-11 01:42:54 UTC
Permalink
I appear to be having the same raise codes.ModuleNotFoundException error
as Sarah Walters.

http://osdir.com/ml/linux.redhat.fedora.func/2008-07/msg00043.html

I am also attempting an install on Ubuntu.

Does that help diagnose?

Cheers,

Joel
Joel Krauska
2011-02-11 03:06:16 UTC
Permalink
Post by Joel Krauska
I appear to be having the same raise codes.ModuleNotFoundException error
as Sarah Walters.
http://osdir.com/ml/linux.redhat.fedora.func/2008-07/msg00043.html
I am also attempting an install on Ubuntu.
Does that help diagnose?
Cheers,
Joel
Problem solved.


Using 'make install' from the git clone on an Ubuntu system installs
func python modules here:
/usr/local/lib/python2.6/dist-packages/func

(On ubuntu, the site-packages folder that contains packages installed
via setup_tools\easy_install\pip will be in
/usr/local/lib/pythonX.X/dist-packages)



func's module_loader.py does this:

import distutils.sysconfig
python_path = distutils.sysconfig.get_python_lib()

But unfortunately that resolves to:
/usr/lib/python2.6/dist-packages

Which is missing '/local'.. :(

I can hardcode, but that's probably not correct.


This seems to be an awkward impediment to making func easy to use on
Ubuntu...


Thoughts?

--Joel
Joel Krauska
2011-02-11 19:51:31 UTC
Permalink
Post by Joel Krauska
Post by Joel Krauska
I appear to be having the same raise codes.ModuleNotFoundException error
as Sarah Walters.
http://osdir.com/ml/linux.redhat.fedora.func/2008-07/msg00043.html
I am also attempting an install on Ubuntu.
Does that help diagnose?
Cheers,
Joel
Problem solved.
Using 'make install' from the git clone on an Ubuntu system installs
/usr/local/lib/python2.6/dist-packages/func
(On ubuntu, the site-packages folder that contains packages installed
via setup_tools\easy_install\pip will be in
/usr/local/lib/pythonX.X/dist-packages)
import distutils.sysconfig
python_path = distutils.sysconfig.get_python_lib()
/usr/lib/python2.6/dist-packages
Which is missing '/local'.. :(
I can hardcode, but that's probably not correct.
This seems to be an awkward impediment to making func easy to use on
Ubuntu...
Thoughts?
--Joel
Patch

--- module_loader.py.orig 2011-02-11 11:48:12.000000000 -0800
+++ module_loader.py 2011-02-11 11:50:16.000000000 -0800
@@ -18,2 +18,3 @@
import sys
+import platform
import traceback
@@ -55,3 +56,9 @@
log = logger.Logger().logger
- python_path = distutils.sysconfig.get_python_lib()
+
+ # Ubuntu python path for added modules is different from Ubuntu
+ if platform.dist()[0] == 'Ubuntu':
+ python_path =
distutils.sysconfig.get_python_lib().replace('usr/lib','usr/local/lib')
+ else:
+ python_path = distutils.sysconfig.get_python_lib()
+
module_file_path = "%s/%s" % (python_path, path)

Loading...