Coder Social home page Coder Social logo

Comments (7)

tallforasmurf avatar tallforasmurf commented on August 18, 2024 1

The problem appears to be that applangdetect is trying to find some file called messages.properties. Correct?

Since this is not a Python file and not brought in by an import in the source code, there is no way for PyInstaller to know it should be included. That is why pyinstaller/pyinstaller#1842 referred the user to the part of the manual that tells how to include data files. The manual is no longer at that URL, it is here: http://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-files-to-the-bundle

You need to figure out what non-Python files applangdetect will need at run-time and modify the .spec file to tell PyInstaller to include them. If you need help in that, you can use the PyInstaller mailing list at https://groups.google.com/forum/#!forum/pyinstaller .

A PyInstaller "hook" is a file that builds this information into the PyInstaller distribution so others who use applangdetect will not need to modify the spec file. Perhaps when you work this out you can contribute a hook file for it.

from pyinstaller-hooks-contrib.

giuliodz avatar giuliodz commented on August 18, 2024 1

I had the same issue. However I used some hooks for this as it was easier in my opinion

Solution guide

  1. In your project root directory (where you execute pyinstaller), create a subdirectory for the hooks. In this case I' ll name it app-hooks/
  2. Generate a file in that folder app-hooks/hook-langdetect.py:
from PyInstaller.utils.hooks import collect_all

datas, binaries, hiddenimports = collect_all('langdetect')
  1. Generate the .spec file by running Pyinstaller at least once.
  2. Modify it to include the hook:
# Leave it unchanged 
# ...
a = Analysis(
             # Leave it unchanged 
             # ...
             hiddenimports=['langdetect'], # <--- just to be sure. It should work without it too.
             hookspath=['./app-hooks/'], # <---- make it point to that hook folder
             # Leave it unchanged 
             # ...
            )
# Leave it unchanged 
# ...
  1. Now rebuild your app using the spec.file pyinstaller --onedir your_file_name.spec --clean

Now the issue is fixed and you can run your app.

from pyinstaller-hooks-contrib.

lrq3000 avatar lrq3000 commented on August 18, 2024

This worked for me:

a = Analysis(
    # your other stuff here...
    datas=[
        ('langdetect/utils', 'langdetect/utils'),  # for messages.properties file
        ('langdetect/profiles', 'langdetect/profiles'), # don't forget if you load langdetect as a submodule of your app, change the second string to the relative path from your parent module. The first argument is the relative path inside the pyinstaller bundle.
          ]
    # the rest of your analysis spec...
    )

from pyinstaller-hooks-contrib.

htgoebel avatar htgoebel commented on August 18, 2024

You may want to provide a hook for this.

from pyinstaller-hooks-contrib.

Aniskonig avatar Aniskonig commented on August 18, 2024

Did you fix it ? I have the same problem and when I followed the previous answer I didn't got the required hooks:

114 INFO: Determining a mapping of distributions to packages...
14033 WARNING: Unable to find package for requirement six from package langdetect.
14034 INFO: Packages required by langdetect:
[]

from pyinstaller-hooks-contrib.

bwoodsend avatar bwoodsend commented on August 18, 2024

If your PyInstaller version is reasonably recent, you should now be able to use:

pyinstaller --collect-datas=langdetect your-code.py

from pyinstaller-hooks-contrib.

Aniskonig avatar Aniskonig commented on August 18, 2024

Thank you so much that's solved my problem

from pyinstaller-hooks-contrib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.