Skip to content
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

Standalone version of atomium #41

Open
BradyAJohnston opened this issue Apr 28, 2022 · 2 comments
Open

Standalone version of atomium #41

BradyAJohnston opened this issue Apr 28, 2022 · 2 comments

Comments

@BradyAJohnston
Copy link

I am having some trouble with people installing atomium from pip (It seems to be a Blender related issue) so I was hoping to try and bundle a version of atomium inside of the addon itself.

I know atomium requires a couple of other packages etc for fetching - would you have advice on how to go about doing this? Do you have the ability to build a standalone version of atomium that I could include, rather than having to install using pip? I'm still early on my python journey (die-hard R fan) so package management inside of python is still new territory for me.

@samirelanduk
Copy link
Owner

I have thought about Dockerising atomium, which would bundle it with all its dependencies, though probably wouldn't solve your problem. I don't use Windows much these days, but I do remember some of the libraries like Numpy and Scipy don't always install too well on there.

I read through the issue linked - I actually haven't tried atomium on Python 3.10 yet. Is it just atomium that seems to have problems installing in the right place? Are there other libraries that install fine?

@BradyAJohnston
Copy link
Author

BradyAJohnston commented Apr 29, 2022

The strange part seemed to be that it was an error across windows mac and linux, but only for some portion of people? I myself couldn't replicate the error.

It seems like the error has now been solved by adding the following code before I try to call import atomium:

import sys
import os
import site

def verify_user_sitepackages():
    usersitepackagespath = site.getusersitepackages()

    if os.path.exists(usersitepackagespath) and usersitepackagespath not in sys.path:
        sys.path.append(usersitepackagespath)

verify_user_sitepackages()

import atomium

Which makes Blender's python aware of the user's local packages. Still unsure why pip was installing there instead of inside of Blender (and only for some users, and even when people were running with admin privileges), but at least this has solved the issue in the meantime.

I would still be interested in a self-contained atomium though. Reducing the number of steps required for installation of the addon, and reducing future potential problems with pip would be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants