Re: func on Ubuntu?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/10/11 7:06 PM, Joel Krauska wrote:
On 2/10/11 5:42 PM, Joel Krauska wrote:
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



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)

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list


[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux