Comments (7)
No worries; I think we're on the right track. Many of the answers and linked Github issues on the above StackOverflow page seem to point to using a PyInstaller hook to resolve this issue. I think something like this will address the issue:
- Find or create the file
hooks-phx-filters.py
(you'll need to do a bit of experimentation/research to find the right location; https://stackoverflow.com/a/52898981/5568265 suggests a possible location).- Discovering where the hooks files get created will teach you a bit about how PyInstaller works under-the-hood, and if you're unable to determine the correct location you can alternatively specify
--additional-hooks-dir
to load hooks from a directory of your choosing (see https://stackoverflow.com/a/28023347/5568265 for more info).
- Discovering where the hooks files get created will teach you a bit about how PyInstaller works under-the-hood, and if you're unable to determine the correct location you can alternatively specify
- Add the following content to
hooks-phx-filters.py
:from PyInstaller.utils.hooks import copy_metadata datas = copy_metadata('phx-filters')
Let me know if you're able to get this working; I see that it is possible to add PyInstaller hooks directly to a package — if the custom hook fixes the issue I'll see about adding it to the phx-filters
library 😺
from iota.py.
Hello! I did as you wrote and it seems that something has moved :)
But I got another error:
Traceback (most recent call last):
File "gam.py", line 12, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "c:\pythonx\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "iotaconn.py", line 5, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "c:\pythonx\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "iota\__init__.py", line 43, in <module>
File "pkg_resources\__init__.py", line 899, in require
File "pkg_resources\__init__.py", line 785, in resolve
pkg_resources.DistributionNotFound: The 'PyOTA' distribution was not found and is required by the application
[13752] Failed to execute script gam
But..
For PyOTA I did exactly like for phx-filters and it works!
datas = copy_metadata('phx-filters')
datas += copy_metadata('PyOTA')
Thank you very much!
Greetings! :)
from iota.py.
Hi @policmajsterdev thanks for reporting this issue!
The key line from the traceback is this one:
pkg_resources.DistributionNotFound: The 'phx-filters' distribution was not found and is required by the application
These pages may be relevant to the issue you're experiencing:
- https://pyinstaller.readthedocs.io/en/stable/operating-mode.html#analysis-finding-the-files-your-program-needs
- https://pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html#helping-pyinstaller-find-modules
Could you post the exact pyinstaller
command you are running to create the exe file?
from iota.py.
Thank you for your answer. My command looks like this:
pyinstaller --noconfirm --onefile --console --add-data "C:/Users/eimea/Desktop/gfx/game/data;data/" "C:/Users/eimea/Desktop/gfx/game/gam.py"
from iota.py.
🤔 I note that the same issue occurred in #193 — I wonder if this is because the phx-filters
lib has a self-referential require
statement:
https://github.com/todofixthis/filters/blob/2.0.2/filters/__init__.py#L3
This is a common practice, so I imagine that pyinstaller users will run into this issue from time to time.
Possibly one of the answers to this StackOverflow post may be helpful here:
https://stackoverflow.com/q/40076795/5568265
Also, double-check that you have the most up-to-date version of pyinstaller; see pyinstaller/pyinstaller#1515 (comment)
from iota.py.
Thanks for your help but I still have a problem. I uninstalled the entire python environment several times, installed it in various combinations, and then nothing.
My version of pyinstaller is 4.1.
I noticed that the boot always stops in the same place when importing a module using 'pyota'.
As you wrote, the problem is somewhere here:
__version__ = require('phx-filters')[0].version
Unfortunately, I'm not that advanced in python and I don't know what to do next.
Thank you for your help, I will keep trying.
from iota.py.
Sweeeet as. Great to see you got it working! I'll make a note of this, so that we can make future versions of PyOTA (and phx-filters 😁) PyInstaller-compatible out-of-the-box.
from iota.py.
Related Issues (20)
- Remove tips parameter from get_inclusion_states API call
- `get_bundles` returns bundle object when no bundle was found
- Increase test coverage for `IsReattachableCommand`
- Add tests for `get_bundles_from_transaction_hashes`
- Async code examples
- PY2 -> PY3 Migration
- Document possible exceptions in api methods
- Include reason for `BadApiResponse` in `PromoteTransactionCommand` HOT 4
- Remove threshold parameter from `getBalance` command
- Remove `get_tips` api command
- Add `is_confirmed` alias for `get_inclusion_states`
- Update references of https://devnet.thetangle.org
- Incompatibility with pyinstaller HOT 2
- Update PyOTA for comnet
- Fix typo in docs parameter description HOT 1
- Removal of checkConsistency
- SSLError: HTTPSConnectionPool(host='nodes.devnet.iota.org', port=443)
- Building wheel for pysha3 (setup.py) error on Ubuntu 18.04.5 LTS Python 3.7.5 HOT 2
- Errors in tutorial 02_send_data.py
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 iota.py.