![]() ![]() ![]() I’m sure this is a bit dumb, but I’m only now getting into the skeleton of Python. Assuming all this, will the basic import statements in pyzotero function properly? So that, if pyzotero.zotero imports pytz, and both pyzotero and pytz are stached in the Workflow Folder, since this larger folder is in sys.path, things should just work as is, right? I will then need to add that folder to sys.path (can I do this in the bash script for the configurator, such that it is universal? Or will I need to add a line to each Python script to add the ZotQuery Workflow Data folder to sys.path before any imports?). Let’s say I also tell pip (or easy_install) to download all of these packages to ZotQuery’s Workflow Data folder. If only pip, I will need to install pip first). One question though: Let’s say I change the configurator to install pyzotero with its dependencies (is this unique to pip, or does easy_install automatically install dependent packages/modules as well? I ask, since not all users will have pip, but easy_install comes standard. All of this new knowledge is leading me to rethink ZotQuery set-up. I see now that adding a package folder to the sys.path will probably be easier. Given my general ignorance, this had tons of problems. I was trying to use relative imports to specify the package/module in the workflow folder I had bundled. The problems I found when trying to bundle packages/modules within the module always centered on explicit import statements. This means it would actually be easier not to bundle pyzotero with the workflow. Firstly, I didn't know that installing one module (pyzotero in this case) via pip will automatically install its dependencies. I am currently researching and testing to teach myself more about Python package management. I ran a script to just grap all of the import statements in the whole workflow. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |