Blender - No module named 'specklepy'

Hey there,

I’ve been following speckle for a while and have just decided to roll my sleeve’s up and have a ‘play’ as we are keen to look at new ways of working for our Arch Tech courses at the Uni I work at. I’ve got the Speckle Manager installed and running and the Revit & Dynamo connector(s) are installed but I am having some problems with speckle-blender. I’ve installed specklepy using pip and confirmed it’s there, but when I try to enable the add-on in blender (2.92) it complains that:

Speckle not found.
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\nige7\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\__init__.py", line 56, in <module>
    from specklepy.api.client import SpeckleClient  # , SpeckleCache
ModuleNotFoundError: No module named 'specklepy'

I am in no way a pythonista (C# is more my game) so am well aware that I am probably missing something super obvious here, but has anyone got any ideas what is going on?

Thanks

1 Like

Hey @NigeDemo !

Welcome to the forum and thanks for your interest in the Blender Connector :blush:

This is partially our fault as we haven’t packaged up the Blender Connecter yet as it’s still very wip :sweat_smile:. I’m actually planning on getting this done this week so if you’d rather chill for a bit and wait to be able to download from Manager then feel free. I’ll come back here and ping when it’s up!

If you want to start playing around now, you’ll need to move the dependencies into the directory Blender is expecting yourself. Blender is packaged with its own version of python and does not use your system wide python installation. Here are the steps:

  1. install poetry
    We use poetry instead of pip for package management. You can get it here

  2. configure poetry to create virtual envs in the proj directory by running this one-time command

poetry config virtualenvs.in-project true
  1. install dependencies by running the following command from within the speckle-blender dir
poetry install
  1. move the dependencies to Blender
    You will see a .venv directory within the speckle-blender directory. In .venv/Lib/site-packages are all the dependencies. You’ll want to take the contents of this folder and paste it into
    AppData/Roaming/Blender Foundation/Blender/2.92/scripts/addons/modules

Hope that helps! Let me know if you run into any issues or if you have any suggestions / feedback! Feel free to introduce yourself in the intros thread as well if you’d like :sparkles:

1 Like

Fabulous explanation, thank you. I am totally a serial early adopter :rofl:

I did wonder if it had something to do with blender using it’s own python install …

I might wait for you to package it up before showcasing speckle to my colleagues in the faculty though :wink:

1 Like

Haha you’re at the bleeding edge with this one :sweat_smile:

I hear ya though! I’ll put this higher on my prios and give you a ping once it’s up on Manager! :+1:

Cheers!

1 Like

OK so I couldn’t wait :rofl:

I’m pretty sure I followed your instructions correctly - I ended up with a site packages folder that looked like this:

Next, I copied that all to a new folder called modules in the blender addons folder in %AppData%, but when I try and enable the addon I now get a slightly different error …

Speckle not found.
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\nige7\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\__init__.py", line 60, in <module>
    from bpy_speckle.operators import *
  File "C:\Users\nige7\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\operators\__init__.py", line 1, in <module>
    from .users import LoadUsers, LoadUserStreams
  File "C:\Users\nige7\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\operators\users.py", line 15, in <module>
    from bpy_speckle.functions import _report
  File "C:\Users\nige7\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\functions.py", line 1, in <module>
    import speckle
ModuleNotFoundError: No module named 'speckle'

It looks like it’s getting a bit further this time - any idea?

Or maybe I should just wait until you’ve packaged up the connector for Blender? Remote debugging is the worse :wink:

Haha I love the enthusiasm :partying_face:

Oh boy ok this is embarrassing, but can you please pull latest from main and re copy over the bpy_speckle folder to addons? Totally my bad, but I guess I didn’t fully clean out all my modules and missed these errors when I swapped over from the local ref to the specklepy ref :sweat_smile: All should work now though hopefully!

Haha - yes I’m can be very enthusiastic at times … lol

OK so that has worked - and the add-on is enabled - time to have a play :grin:

Thanks for your help with this :raised_hands:

OK so I’m going to leave this for tonight but I can now select my only stream (created from Revit) from the Speckle UI in Blender and while I can see the ‘Stream101’ collection has been added in the Outliner there doesn’t appear to be any geometry attached to it … ? Any idea why that is?

Once again, thanks for your help today. I think I’m going to enjoy using Speckle :grinning:

1 Like

Hmm that’s a bit odd - in theory anything with a display mesh should come through with geometry. I’ll have to do some testing on my own to figure out what’s going on. Thanks for letting me know! The Blender connector is very wip at the moment, so there are quite a few rough edges :sweat_smile:

Full transparency though, the main workflow that is being tested right now is between Rhino and Blender. If you have a fun Rhino model handy, feel free to give that a go and let me know how it goes!

Also, there will be a lot of changes getting merged in very soon, so stay tuned :sunglasses:

3 Likes

OK no worries. Totally understand.

I don’t use Rhino but I’ve installed a trial so will have a play with that over the next few days. To be honest, I probably need to fully get my head around what Speckle is capable of using platforms/software that I’m familiar with first, haha. Thanks for you time :+1:

1 Like

Fair play! If you’d like, you can have a look at some of our interop tutorials to help you out. For instance, we’ve got a Rhino to Revit tutorial which includes a sample Rhino model which you can download and play with! I’ve personally received this model in blender from speckle for testing :star2:

((the materials support you see here to be merged in imminently :sweat_smile:))

1 Like

hey @NigeDemo i’m back with some news ~

the Blender Connector is finally out on manager :partying_face::partying_face::partying_face:

same warnings as before apply though - it is still very wip and there are a lot of rough edges :sweat_smile: but at least now you and your colleagues will be able to easily install it!

if you have any feedback, requests, or even desire to contribute :eyes: just hit me up or add an issue to the github repo! excited to see what you get up to with this :sparkles:

2 Likes

Hey @izzylys - finally got some time to play with the blender connector. Firstly, good job :ok_hand:

OK so here is what I have done so far. I exported one of the sample Revit projects as an IFC and used the BlenderBIM addon to get it into Blender. I created a new stream in the blender connector and tried pushing / commiting stuff. Yay :raised_hands:. So obviously the first I did was to try breaking it by pushing the whole project, haha, and sure enough I got a Traceback error:

Python: Traceback (most recent call last):
  File "C:\Users\****\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\operators\streams.py", line 376, in execute
    hierarchy = get_collection_hierarchy(collection)
  File "C:\Users\****\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bpy_speckle\operators\streams.py", line 161, in get_collection_hierarchy
    names = [collection.name.replace("/", "::").replace(".", "::")]
AttributeError: 'NoneType' object has no attribute 'name'

location: <unknown location>:-1

Turns out that the wind turbine objects in that scene were causing this issue, so I deleted them and tried again. This time even though I had the whole project selected (blender told me it was pushing 467 elements) the only bit of geometry that came through was the topo surface. Checking the stream on the web interface, the Base object total children count is 1107 but there is only one mesh object in the data list.
Soooo, next I tried removing the topo surface from the selection - this was somewhat more successful and most things came through OK except for the curtain wall objects. Windows came through fine, just not the curtain walls. Strangely though if I select one of the curtain walls and push that it comes through fine?? :upside_down_face: :slightly_smiling_face:

Incidentally if I import the same project as an FBX, it all gets through OK - which is to be expected really. FBX is a geometry focused data format whereas geometry is really only implicit within an IFC file so I suspect that the deeply nested and cross referenced nature of the IFC format is possibly what’s causing these probs.

Can’t wait for the day this all gets sorted though as IFC’s are key to the inclusion of open source toolchains within the AEC industry - OpenBIM ftw

Hope that’s useful info - I can share the stream I was playing with here if that’s useful?

2 Likes

Hey Nige!

So glad to see you’ve been trying out the connector! This info is super helpful to me as someone who admittedly hasn’t been a heavy user of IFC. All error reports are super welcome as I try to iron out how this all should work in the speckleverse. I would be very interested to see the stream if you can share! You can add me as a collaborator at izzy@speckle.systems or just link it here if it’s public.

Regarding that particular error, that is definitely a bug :sweat_smile: Thanks for catching it! I’ve logged the issue and will tackle it asap. If you stumble upon any other errors, please don’t hesitate to dump them in a github issue so I can take a look!

I really appreciate your providing this helpful feedback! Don’t be shy about dropping any other problems you encounter or suggestions you might have here :blush:

1 Like

Hey Izzy,

I’ve been on holiday from all things work for the last week so sorry I haven’t got back with the link sooner. So here’s the link to that BlenderBIM stream Stream | Speckle - as you can see I left the commit messages pretty much ‘as is’ as they described how many object the connector thought it was pushing :smiley:

Hope this is still useful.

1 Like

Thanks a lot @NigeDemo !

This was totally useful and your feedback is appreciated! I should have resolved at least some of your issues with the latest PR - a release of 2.1.0 should be out shortly :partying_face:

2 Likes