OK, I think it’s working now! I assumed that pygtk2 was installed since I was 
able to access the Pygwy Console, but I looked and saw that neither `sudo dnf 
install gwyddion.x86_64` nor `sudo dnf install gwyddion-devel.x86_64`installed 
it. Following `sudo dnf install pygtk2.x86_64`, the Pygwy Console appears to 
be working (no errors from `import gwyutils` or `d = 
gwy.gwy_app_data_browser_get_current(gwy.APP_DATA_FIELD)`). A standalone Pygwy 
script consisting only of…

#!/usr/bin/python2
import gwy
print(gwy.__file__)

…also seems to work, although I do get a message from gtk; the output is…

Gtk-Message: 16:54:06.966: Failed to load module "pk-gtk-module"
/usr/lib64/python2.7/site-packages/gwy.so

…but if the pk-gtk-module thing isn’t important, then I think we are up and 
running. Thank you so much!

From: David Nečas (Yeti) <y...@gwyddion.net>
Date: Friday, October 25, 2024 at 12:39 PM
To: Gwyddion use discussion <gwyddion-users@lists.sourceforge.net>
Subject: Re: [Gwyddion-users] Python error when trying to build from source 
with pygwy support
On Fri, Oct 25, 2024 at 04:42:21PM +0000, Smith, Justin wrote:
> OK, so I have installed VirtualBox on an Intel Mac (if you think this is a
> problem I can alternatively make the virtual machine on my Ubuntu computer) 
> and
> installed Fedora 40 as a virtual machine. Within the virtual machine, I then
> downloaded and installed the F40 repository configuration. From the command
> line I then did `sudo dnf install gwyddion.x86_64`, which successfully
> installed Gwyddion. However, within the Pygwy Console I am still encountering
> the same problem with the gwy module not being found.

You do not need to do ‘import gwy’ in the console because it's
automatically there. However, if you run it, it should still work. I
have just tested the F40 packages and it works fine for me.

> A simple script consisting of `import gwyutils` when executed first
> gives the output…

For standalone scripts you also need to install gwyddion-devel which
installs the standalone gwy module (the one in the console is just
created on the fly there).

> Traceback (most recent call last):
>
>   File "<string>", line 7, in <module>
>
> ImportError: No module named gwy
>
> Traceback (most recent call last):
>
>   File "<string>", line 1, in <module>
>
>   File "/usr/share/gwyddion/pygwy/gwyutils.py", line 1, in <module>
>
>     import gwy
>
> ImportError: No module named gwy
>
> …and executing it a second time gives only the second traceback/error message.
> What am I doing wrong here?

You may be running it under Python 3 (because that is the default) and
you do not have gwyddion-devel.

However, I do not understand the console problem.

Regards,

Yeti



_______________________________________________
Gwyddion-users mailing list
Gwyddion-users@lists.sourceforge.net
https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/gwyddion-users__;!!LkSTlj0I!CbAfJ-q-cZHUqGAZ7mzgo5LmsE1HLG5pWQMvtv88Z6Nd5saCidnFmGCmgKLy7JYhklZPDKCfES5tuxioc8NGeQ$<https://urldefense.com/v3/__https:/lists.sourceforge.net/lists/listinfo/gwyddion-users__;!!LkSTlj0I!CbAfJ-q-cZHUqGAZ7mzgo5LmsE1HLG5pWQMvtv88Z6Nd5saCidnFmGCmgKLy7JYhklZPDKCfES5tuxioc8NGeQ$>
_______________________________________________
Gwyddion-users mailing list
Gwyddion-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to