Git Product home page Git Product logo

Comments (15)

2press avatar 2press commented on September 26, 2024 5

The issue is with

__version__ = VERSION = pkg_resources.get_distribution(__name__).version

You can have a look at the discussion at googleapis/google-cloud-python#1187 and pyinstaller/pyinstaller#2294.

There is a workaround by creating hook-humanize.py and adding it to the hooks of pyinstaller:

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('humanize')

from humanize.

2press avatar 2press commented on September 26, 2024 1

Are you sure that the you have implemented the workaround correctly and that it is still not working? See https://github.com/teampheenix/StarCraft-Casting-Tool for an example:

If this is the case, please provide a complete minimal example.

from humanize.

nicoddemus avatar nicoddemus commented on September 26, 2024 1

Thanks @2press for providing the workaround.

I've opened pyinstaller/pyinstaller-hooks-contrib#122 to include the hook in the standard PyInstaller hooks districution.

from humanize.

hugovk avatar hugovk commented on September 26, 2024 1

Thank you! pyinstaller/pyinstaller-hooks-contrib#122 has been merged so let's close this.

from humanize.

hugovk avatar hugovk commented on September 26, 2024

Thanks for the report.

I'm not familiar with pyinstaller or wx, please can you give me step by step instructions on how to reproduce, along with any necessary config files?

What Python version are you using?

Where is it trying to retrieve the humanize distribution from?

When I change back to the old version(v0.5.5), there is no such problem

I presume you mean the 0.5.1, which was the last one before 1.0.0.

from humanize.

hugovk avatar hugovk commented on September 26, 2024

Also, if it's possible to run wx in verbose mode (maybe wx -v or wx --verbose), that might give more info.

from humanize.

Gaoyongxian666 avatar Gaoyongxian666 commented on September 26, 2024

Yes,it is the 0.5.1.Of course, it's only when I use pyinstaller to package. There's no problem when I use it in Python.

I didn't use the library you wrote directly. I used someone else's library. He used your library in his library. His library name is uiautomator2. It's the one with the most stars.

WX-----This is a file I wrote myself. This file is useless.

from humanize.

Gaoyongxian666 avatar Gaoyongxian666 commented on September 26, 2024

I can show you the steps. You can restore the environment, but I don't think it's very effective. Because it could be a problem with pyinstaller.

from humanize.

Gaoyongxian666 avatar Gaoyongxian666 commented on September 26, 2024

As for pyinstaller, I don't know how he retrieved it. But if I reinstall humanize 0.5.1 and then use pyinstaller to package, there will be no problem

from humanize.

Gaoyongxian666 avatar Gaoyongxian666 commented on September 26, 2024

Pyinstaller has a problem with the latest version 3.6. For example,If the version of setuptools is too high, there will be a problem.At that time, I had to reduce the version of my setuptools.Give you a reference:setuptools 45.2.0,this is too high,I use setuptools==40.
For humanize,You can think of the difference between the latest two versions.

from humanize.

Gaoyongxian666 avatar Gaoyongxian666 commented on September 26, 2024

574 INFO: Python: 3.6.6
575 INFO: Platform: Windows-10-10.0.18362-SP0

from humanize.

RyanLiuF avatar RyanLiuF commented on September 26, 2024

I have got the same problem too.

ERROR:root:The 'humanize' distribution was not found and is required by the application
Traceback (most recent call last):
  File "main.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "d:\program files\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\uiautomator2\__init__.py", line 34, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "d:\program files\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\humanize\__init__.py", line 7, in <module>
  File "site-packages\pkg_resources\__init__.py", line 481, in get_distribution
  File "site-packages\pkg_resources\__init__.py", line 357, in get_provider
  File "site-packages\pkg_resources\__init__.py", line 900, in require
  File "site-packages\pkg_resources\__init__.py", line 786, in resolve
pkg_resources.DistributionNotFound: The 'humanize' distribution was not found and is required by the application

python version: 3.7.4
windows: 10
pyinstaller : 3.5

from humanize.

RyanLiuF avatar RyanLiuF commented on September 26, 2024

Meanwhile, I am trying to install the version of 0.5.1, the problem is fixed, with the same version of pyinstaller and python.

from humanize.

hugovk avatar hugovk commented on September 26, 2024

@RyanLiuF Please use the workaround in #105 (comment).

from humanize.

RyanLiuF avatar RyanLiuF commented on September 26, 2024

@hugovk of course, I have tried the workaround , but it doesn't work. thanks for your replay.

from humanize.

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.