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

ModuleNotFoundError #23

Closed
Radivarig opened this issue Jan 6, 2019 · 11 comments

Comments

@Radivarig
Copy link

commented Jan 6, 2019

I'm running blender 2.80 from docker like this:

#!/bin/sh
exec \
  docker run -t \
  -e ADDON_DIRECTORIES_TO_LOAD \
  -e EDITOR_PORT \
  -e ALLOW_MODIFY_EXTERNAL_PYTHON \
  -e DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v /home/radivarig/:/home/radivarig \
  --network="host" \
  --device /dev/snd \
  ubuntu/blender:version3 \
  ./home/radivarig/projects/blender-env/blender-2.80-4dd0a90f4213-linux-glibc224-x86_64/blender "$@" \

I select it as blender executable after running Blender: Start, blender does opens but throws:

File "/home/radivarig/projects/blender-env/blender-2.80-4dd0a90f4213-linux-glibc224-x86_64/2.80/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'TestAddon'

The addon symlink is created under '/root/.config/blender/2.80/scripts/addons' inside the docker container and when I reset to factory settings or open blender by hand enabling the addon does work.

Any ideas?

@JacquesLucke

This comment has been minimized.

Copy link
Owner

commented Jan 6, 2019

Unfortunately I have no experience with Docker, so I don't know how it might impact the extension.

How is your addon structured?

When you start Blender the normal manually, can the addon load when it is symlinked into the addon directory?

Is it possible that docker somehow redirects the symlink, so that Blender can't find your source code files?

@Radivarig

This comment has been minimized.

Copy link
Author

commented Jan 6, 2019

It's the default addon created with Blender: New Addon. When I open blender with the above docker script by hand, or when I open it with Blender: Start and then do File > Load Factory Settings I see and can enable the addon manually from Edit > Preferences... > Add-ons. The file is symlinked in the addons folder and I can toggle the enable checkbox for it.

@JacquesLucke

This comment has been minimized.

Copy link
Owner

commented Jan 6, 2019

hmm ok, I'm confused.
I don't really have any idea why this is happening right now, sry..

@jessey-git

This comment has been minimized.

Copy link

commented Jan 7, 2019

It's probably not related to docker. I've seen this happen as well on raw win10. For me it happened because I started with a completely blank Blender config directory and attempted to launch blender with my addon right away from vscode. To fix this I had to launch blender by itself first, and then enable my addon manually.

After that I was able to use the vscode extension normally. It seems that the extension has trouble if the addon doesn't exist yet?

@JacquesLucke

This comment has been minimized.

Copy link
Owner

commented Jan 7, 2019

Maybe, have to check that. You mean that the "addons" directory does not exist yet?

@jessey-git

This comment has been minimized.

Copy link

commented Jan 7, 2019

I mean the entire C:\Users\username\AppData\Roaming\Blender Foundation\Blender\2.80 hierarchy doesn't exist -- this includes the top-level "config" and "scripts" directories which would also include addons.

I do this every ~2 weeks to ensure I'm loading true beta defaults everywhere etc.

@Radivarig

This comment has been minimized.

Copy link
Author

commented Jan 8, 2019

@jessey-git that was it! I've started it once, did docker commit and the extension works. Thanks!

@Radivarig Radivarig closed this Jan 8, 2019

@jessey-git

This comment has been minimized.

Copy link

commented Jan 8, 2019

I'd actually vote to keep the issue open as it's a bug in the extension that could be fixed I think

@Radivarig Radivarig reopened this Jan 8, 2019

JacquesLucke added a commit that referenced this issue Jul 12, 2019

Merge pull request #42 from schlegel11/feature/Fix_ModuleNotFoundErro…
…r_#23

Fix for issue #23 ModuleNotFoundError
@schlegel11

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

Hi,
I found this great visual studio plugin the last days 😃
Unfortunately I got the here described ModuleNotFoundError exception under the same circumstances @jessey-git describes here #23 (comment).
I think I fixed the issue and added a pull request #42.
(Which is already merged ... holy cow that was fast 😄 )

Greetings

@Radivarig

This comment has been minimized.

Copy link
Author

commented Aug 17, 2019

@schlegel11 thanks!

@Radivarig Radivarig closed this Aug 17, 2019

@Radivarig

This comment has been minimized.

Copy link
Author

commented Aug 17, 2019

@jessey-git could you publish an update to the vscode market?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.