Comments (15)
The issue is with
humanize/src/humanize/__init__.py
Line 7 in b28d9ad
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.
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:
- Add
hook-humanize.py
as in https://github.com/teampheenix/StarCraft-Casting-Tool/blob/master/hooks/hook-humanize.py - Add the directory of
hook-humanize.py
to thehookspath
in the PyInstaller spec-file.
If this is the case, please provide a complete minimal example.
from humanize.
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.
Thank you! pyinstaller/pyinstaller-hooks-contrib#122 has been merged so let's close this.
from humanize.
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.
Also, if it's possible to run wx
in verbose mode (maybe wx -v
or wx --verbose
), that might give more info.
from humanize.
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.
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.
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.
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.
574 INFO: Python: 3.6.6
575 INFO: Platform: Windows-10-10.0.18362-SP0
from humanize.
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.
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.
@RyanLiuF Please use the workaround in #105 (comment).
from humanize.
@hugovk of course, I have tried the workaround , but it doesn't work. thanks for your replay.
from humanize.
Related Issues (20)
- Generate files during built process HOT 1
- Allow to specify gender for ordinals
- Humanize
- Importing humanize is slow HOT 9
- Translation activation does not work because of missing .mo files HOT 3
- 3.7.1: pytest is failing HOT 3
- Installing from source installs humanize with version = 0.0.0 HOT 4
- Incorrect precisedelta() calcualation HOT 6
- 3.11.0: pytest cannot find locale files during the tests HOT 1
- Documentation shows private functions HOT 6
- Test on Python 3.10.0 final HOT 8
- Use another augmented assignment statement HOT 1
- humanize raises DeprecationWarning upon import HOT 3
- humanize overflows before datetime does HOT 11
- Docs for naturaldelta are wrong/incomplete HOT 5
- Short scale instead of long scale for Polish locale HOT 2
- Issues with odd months when restricting to "day" precision HOT 1
- Single letter instead of, e.g. "million"? HOT 1
- Test issue
- Test issue 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from humanize.