-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFound when creating a new plugin. #1327
Comments
When we package for windows we don't include the entire python stdlib (It's quite large and would balloon our binaries quite a lot) -- You will either want to run EDMC from source while testing or ask us to include the library in our next release (Though an entire WSGI frontend might be a bit much). |
In that case the docs maybe should be updated to reflect that. |
Yeah its not amazingly clear. I'll see about modifying it when Im a bit more awake. |
Thank you for your help, on one hand I'm relieved it was not me botching everything with a rookie mistake, on the other hand I guess it might have been easier to solve that way :-) I had tried adding Re: asking you to include the module, I wouldn't want to inconvenience you and I am happy to explore alternative solutions. Even if I ran EDMC from source, which I am not sure I am capable of doing with my limited skills, would that in any way ensure that my plugin will run when deposited in the plugin folder of someone else's installation? |
No, as if they're using our provided installer then they only get the modules we ship. More specifically we only ship what
Outside of that it's up to a third-party plugin developer to include the necessary modules in their plugin. For some things it might end up being better to implement the 'meat' of such a plugin as its own standalone installation with some IPC mechanism for the 'stub' EDMC plugin to talk to it. Another possible issue with anything 'meaty' is if your plugin code is trying to do too much in the main EDMC thread with possible impact on other parts of the program (i.e. causing laggy UI during long-running functions). |
Indeed, that's an error, probably on my part, thinking I was referring to only the core of Python, and not all the extra modules that come with a standard python install. Now I'm not quite sure how to word it so as to be:
|
Alright thank you, that was my guess as well. At this point then I think what I would need is a way to have wsgiref, as a module, available locally to my plugin, whether by pip installation or by copying manually certain files, and hoping it doesn't in turn require other modules that are not provided by EDMC. |
I think, in the first instance, we should look at the 'Lib' directory in a standard Windows python install and then add all the modules there into setup.py |
Just wanted to say that by copying the entire directory |
You should use a copy from python 3.9.7, just in case there are any differences, and track the version we're building against. But, yes, we'll keep this open as a reminder for future enhancement. |
Thank you for your reply. I used a 3.8.10 base dir because I had either that or the latest version, and I thought it safer to use an older version. As it seems to be working fine, I'll leave that for now. |
A note for when we address this, you can find all the available modules in Python 3.10 using sys.stdlib_module_names Ref: https://realpython.com/python310-new-features/#more-information-about-your-python-interpreter We still need to determine which are single-file modules and which are packages, because they need putting in separate arrays in the setup.py configuration. That and current py2exe needs any sub-part of a package listing separately, you can no longer just list the top level name. |
Space considerations for including all of stdlib:
|
NB: If we effectively do "zip up the main python install's Lib into the py2exe library.zip" then it would need to be aware of if a |
Yeah Ive been puzzling over if we did that how to order |
NB: We'd need all of the DLL directory as well, if py2exe doesn't bring contents in as appropriate. |
Describe the bug
Disclaimer: I am not an expert Python coder.
I am in the process of creating a plugin that will ultimately interface with a document in my google drive.
I followed a tutorial regarding how to use the python module
gspread
, and I created, outside of EDMC, a working python script that authenticates and handles a document remotely. It consists of four lines of code and it works as I want it to; no problem so far and nothing that concerns EDMC.I created a directory for my new plugin, within
C:\Users\myuser\AppData\Local\EDMarketConnector\plugins\
, and inside that directory, I created arequirements.txt
file, containinggspread
. After that, I proceeded with apip install -r requirements.txt -target .
which downloadedgspread
and all of its (multiple) dependencies and saved them in the directory itself (I was under the impression that this is the required modus operandi if a plugin needs additional modules).My
load.py
file contains among the first lines,import gspread
.This caused the following error in
EDMarketConnector.log
:I was puzzled that this
wsgiref
module was not found so I tried to understand what it exactly does. If I am not mistaken, apparently it is included in the Python Standard Library (https://docs.python.org/3/library/) which, according to this file (https://github.com/EDCD/EDMarketConnector/blob/main/PLUGINS.md) should render it automatically available. My very limited powers of investigation stopped here and at that point I decided to compile this issue report. I am grateful for your help.To Reproduce
Steps to reproduce the behavior:
Not applicable.
Expected behavior
The plugin is successfully activated by EDMC.
Screenshots
Not applicable.
Additional context
Nothing to add.
The text was updated successfully, but these errors were encountered: