-
Notifications
You must be signed in to change notification settings - Fork 8
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
switch to pypi version of MolecularNodes #1
Conversation
hi @BradyAJohnston , thanks for this pr! Great to hear that molecular nodes is on pypi now! This will make maintaining this package much more simple. And actually, the previous implementation with that package folder was in the project did not working because of this line I got this error, which is fixed now :) from ipyblender_experimental import BlenderWidget ---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
[/Users/jan-hendrik/projects/ipyMolecularNodes/debugging_import.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/debugging_import.ipynb) Cell 1 line 1
----> [1](vscode-notebook-cell:/Users/jan-hendrik/projects/ipyMolecularNodes/debugging_import.ipynb#W0sZmlsZQ%3D%3D?line=0) from ipyblender_experimental import BlenderWidget
File [~/projects/ipyMolecularNodes/src/ipyblender_experimental/__init__.py:3](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/~/projects/ipyMolecularNodes/src/ipyblender_experimental/__init__.py:3)
1 import importlib.metadata
2 import pathlib
----> 3 from .render_to_image import render_to_image
4 from .render_to_gltf_model import render_to_gltf_model , render_to_gltf_structure
5 import anywidget
File [~/projects/ipyMolecularNodes/src/ipyblender_experimental/render_to_image.py:5](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/~/projects/ipyMolecularNodes/src/ipyblender_experimental/render_to_image.py:5)
2 import base64
3 from pathlib import Path
----> 5 from . import MolecularNodes as mn
8 def apply_mods(obj):
9 """
10 Applies the modifiers on the modifier stack
11
(...)
14 vertices of the object.
15 """
File [~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/__init__.py:33](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/__init__.py:33)
30 import bpy
31 from . import utils
---> 33 auto_load.init()
35 def register():
36 auto_load.register()
File [~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/auto_load.py:25](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/auto_load.py:25), in init()
22 global modules
23 global ordered_classes
---> 25 modules = get_all_submodules(Path(__file__).parent)
26 ordered_classes = get_ordered_classes_to_register(modules)
File [~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/auto_load.py:53](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/auto_load.py:53), in get_all_submodules(directory)
52 def get_all_submodules(directory):
---> 53 return list(iter_submodules(directory, directory.name))
File [~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/auto_load.py:57](https://file+.vscode-resource.vscode-cdn.net/Users/jan-hendrik/projects/ipyMolecularNodes/~/projects/ipyMolecularNodes/src/ipyblender_experimental/MolecularNodes/auto_load.py:57), in iter_submodules(path, package_name)
55 def iter_submodules(path, package_name):
56 for name in sorted(iter_submodule_names(path)):
---> 57 yield importlib.import_module("." + name, package_name)
File [/opt/homebrew/Cellar/python](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Cellar/python)@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126, in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'MolecularNodes' |
For the new version, I had to change |
yeah I don't know why it goes lowercase, any ideas? |
I found
|
It uses capital letters on PyPi (https://pypi.org/project/MolecularNodes/) but it just turns into lowercase when installed? |
good question! ChatGPT saies:
https://chat.openai.com/share/464b23d9-515b-4d77-8e27-c82d08c67cce I don't know why it shows up with the capital letters on pypi. |
I found lots of discussion on the poetry repo (python-poetry/poetry#1538). It seems to be somewhat unresolved. It is still unclear to me why on pypi it is listed with capitals, but installs as lowercase. |
I put Molecular Nodes up on pypi, so it can be installed from there and no longer requires
the internal packaging. The example
.ipynb
now works with the the installed version.