Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3 Yapsy with py2exe problem

v1.x
closed
nobody
1
2012-11-12
2012-11-11
Anonymous
No

I'm working with Python. My file GUI.py uses Yapsy for including new plugins into my software. I have finished all my work and now I want to use py2exe to generate a executable. But when I tried execute my .exe file, my software didn't add my plugins.
I have used breakpoints and yapsy works fine, but it doesn't find my plugins directory. The directory's name is the same.
The path is fine and the directory is into the path. I don't know why it doesn't find the plugins directory after packing with py2exe. My code line for set the directory is the same in other web pages: self.manager.setPluginPlaces(["plugins"])

Now I think the problem is that when I pack my software, Yapsy loses the place where Yapsy must search the plugins, but I don't know. I posted my problem in this link too: http://stackoverflow.com/questions/13295535/how-to-include-yapsy-with-py2exe

Discussion

  • Thibauld Nion
    Thibauld Nion
    2012-11-11

    I will need some precisions on your problem (please consider that I'm not under windows right now and can't check this by my own today).

    • the plugins that should be loaded are in packaged together with yapsy or they are sitting in your system by themsleves ?

    • when you say that the "path is fine" in what context did you check that ? Was it before or after packaging ? I'm sorry if the question looks silly but from my experience with py2exe and packaging, getting the paths right in the development version and in the packaged apps is one of the trickiest thing.

    At least for the sake of testing it would be interesting to put an absolute path to setPluginPlaces and to get the value of this absolute path when running the "packaged" version of the software.

     

    • Anonymous
      2012-11-11

      Thank you so much for your reply. I'm exausted with this problem. Before packing, everything works fine. I have used the plugins directory to add plugins to my software. After packing, I don't know where Yapsy is searching the plugins. I have used absolute path too, and the results are the same. I have used for setting the directory of the plugins this options:

      1. self.manager.setPluginPlaces([os.getcwd() + os.sep + "plugins"])
      2. self.manager.setPluginPlaces(["plugins"])
      3. self.manager.setPluginPlaces(["C:" + os.sep + "plugins"])

      I have executed like administrator, to know if that is the problem, but it doesn't.

      I have used this code lines to know where I am:

      print(os.getcwd(),os.curdir)
      print(os.path.dirname(sys.executable))
      print("Voy a buscar un plugin")
      print(self.manager.getPluginsOfCategory("Formatters"),
      self.manager.getAllPlugins())



      And I have obtained this results before packing:

      ('C:\Users\Jaime\Python\PImageQT\src', '.')
      C:\Python27
      Voy a buscar un plugin
      ([<yapsy.PluginInfo.PluginInfo object="" at="" 0x05120DF0="">], [<yapsy.PluginInfo.PluginInfo object="" at="" 0x05120DF0="">])

      And I have obtained this results after packing:

      ('C:\Users\Jaime\Python\PImageQT\src\dist', '.')
      C:\Users\Jaime\Python\PImageQT\src\dist
      Voy a buscar un plugin
      ([], [])

      The plugins directory is into both paths.

      For packing all, I have used the same solution that this link:
      http://notinthestars.blogspot.com.es/2011/04/using-python-plugin-scripts-with-py2exe.html

      Again, thank you very much.

       
      • Thibauld Nion
        Thibauld Nion
        2012-11-11

        ok, maybe the path is good inside yapsy too (if you're passing the right path, yapsy takes it as-is).

        First thing to do now is to activate the logging with the following code snippet:

        import logging
        logging.basicConfig(level=logging.DEBUG)

        you should quickly see if somethng bad happens inside yapsy.

         

        • Anonymous
          2012-11-12

          Thank you very much Thibauld Nion. I have used your solution to eclipse and I have found my problem.
          In my plugin, I have used a library that Yapsy didn't find. I have especified this librarys in setup.py file to py2exe and everything works fine.

          Again thank you.

           
          • Thibauld Nion
            Thibauld Nion
            2012-11-12

            No worries, I'm glad your problem is solved and hope yapsy will prove useful to you !

             

  • Anonymous
    2012-11-11

    Thank you so much for your reply. I'm exauted with this problem.

    All works fine before packing and Yapsy works great. After packing I don't know where Yapsy search the plugins. I have used all of this options for setting the plugin's path:

    1. self.manager.setPluginPlaces([os.getcwd() + os.sep + "plugins"])
    2. self.manager.setPluginPlaces(["plugins"])
    3. self.manager.setPluginPlaces(["C:" + os.sep + "plugins"])

    I have executed like administrator, to know if that is the problem, but it doesn't.

    To know where I am, I have used this code lines:

    print(os.getcwd(),os.curdir)
    print(os.path.dirname(sys.executable))
    print("Voy a buscar un plugin")
    print(self.manager.getPluginsOfCategory("Formatters"),
    self.manager.getAllPlugins())



    And I have obtained this results after packing:

    ('C:\Users\Jaime\Python\PImageQT\src\dist', '.')
    C:\Users\Jaime\Python\PImageQT\src\dist
    Voy a buscar un plugin
    ([], [])

    To packing the plugins I have used the same solution like this link:
    http://notinthestars.blogspot.com.es/2011/04/using-python-plugin-scripts-with-py2exe.html

    Again thank you very much.

     


Anonymous


Cancel   Add attachments