No Module Named Blender Error
Contents |
a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers blender script editor or posting ads with us Blender Questions Tags Users Badges Unanswered Ask Question _ Blender
Blender Python
Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. Join them; it
Blender Api
only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top ImportError: No module named 'Blender' up vote 1 down vote
Blender Download
favorite I'm new to Blender scripting (and to python too), I started to try to use it but I already get some error... Traceback (most recent call last): File "", line 1, in ImportError: No module named 'Blender' This is my script... import Blender I know this sounds ridiculous, but I cannot find the solution... python scripting share|improve this question edited Dec 3 '15 at 21:39 zeffii 25.3k24198 asked Dec 3 '15 at 20:28 katsele 504 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted It looks like you are following a tutorial/code written for Blender 2.49 or lower. However, if you are running that code in a current version of Blender 2.50 and upwards there is no module named Blender. That's why you get that Import Error. A good place to get information about the current API and Blender script writing in general is the current documentation. It contains : Blender/Python Quickstart: new to blender/scripting and want to get your feet wet? Blender/Python API Overview: a more complete explanation of python integration Blender/Python Addon Tutorial: a step by step guide on how to write an addon from scratch Blender/Python API Reference Usage: examples of how to use the API reference docs Best Practice: Conventions to follow for writing good scripts Tips and Tricks: Hints to help you while writing scripts for blender Gotcha’s: some of the problems you may come up against when writing scripts ...and a whole lot more :) share|improve this answer edited Dec 3 '15 at 21:38 answered Dec 3 '15 at 21:10 zeffii 25.3k24198 1 Thanks! I'm running on Blender 2.76, so I'm sure it will be useful. Let's dig into that! –katsele Dec 3 '15 at 21:31 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using G
a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Blender Questions Tags Users Badges Unanswered Ask Question _ Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top getting started: no module called bpy outside of Blender up vote 6 down vote favorite 1 After http://blender.stackexchange.com/questions/42502/importerror-no-module-named-blender sudo apt-get install blender on Ubuntu 12.10, I have Blender version 2.63 However, I can not import the relevant scripting Library Python 3.2.3 (default, Sep 25 2013, 19:36:10) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import bpy Traceback (most recent call last): File "
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://stackoverflow.com/questions/31015921/importerror-no-module-named-blender posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join http://stackoverflow.com/questions/7887262/blender3d-python-script-issue-importerror-no-module-named-mymodule the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ImportError: No module named Blender up vote 0 down vote favorite I worked with Blender 2.49 and in my script I used from Blender import *. But now I'm upgrading my code to Blender 2.74 and when no module I run appears this error No module named Blender. There have been changes to call Blender module in version 2.74? python blender share|improve this question asked Jun 24 '15 at 1:03 Jimmy 11 Is your path to Blender 2.74 the same as for Blender 2.49? –boardrider Jun 24 '15 at 1:05 Try install afer uninstall.pip uninstall blender then pip install blender then from Blender import...... –HelloNewWorld Jun 24 '15 at 1:10 @boardrider. My path to no module named Blender 2.74 is different to Blender 2.49. –Jimmy Jun 24 '15 at 13:17 So, there's your answer. Follow @HelloNewWorld suggestion and you should be able to use the Blender 2.74 module. –boardrider Jun 24 '15 at 20:59 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote From 2.50 blender started using python 3.x and the python api was completely changed. From 2.63 bmesh (supporting n-gons) was added which changed the way mesh editing was done. You may want to start with some python 2 to 3 docs as some parts of your script may need changes to work in python 3.x. You can find the new api reference online and I would suggest you start with the quickstart and overview listed on that page, maybe even experiment with the sample script templates that you can find in blender's text editor. Once you have an idea of the new python api take a go at re-doing your script. You will also find better help for blender specific python scripting at blender.stackexchange.com share|improve this answer answered Jun 24 '15 at 10:20 sambler 2,7251510 I read about that. I changed my code to support python 3.X but I think this problem is about Blender syntax, and not Python. Thanks for your comment, I going to search more about this. –Jimmy Jun 24 '15 at 13:15 The python3 changes needed should be small, depending on y
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Blender3D : Python script issue “ImportError: No module named MyModule” up vote 2 down vote favorite Hi I'm trying to use multiple python files in my Blender3D script. (eg. MyScript.py and MyModule.py). MyScript.py looks like: import bpy import math from add_utils import AddObjectHelper, add_object_data import mathutils # this line doesn't work import MyModule #### REGISTER #### def register(): pass def unregister(): print("Finished") if __name__ == '__main__': register() Running the script within Blender3D, I get the error: "ImportError: No module named MyModule" I have setup Blender3D's "script" folder to point at the folder containing my script and MyModule.py. Thanks for any help. J python blender share|improve this question asked Oct 25 '11 at 9:29 JimFing 81211 If you print sys.path before import MyModule, is the path to your module in that list? –jro Oct 25 '11 at 9:31 hmm no it's not. How would I go about telling Blender about this path? –JimFing Oct 25 '11 at 9:34 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote accepted Something has to add the proper path to the sys.path variable. I don't know it for Blender specifically, but in general, you could add it as follows: sys.path.append(r'.\mymodule') # Relative path sys.path.append(r'C:\path\to\my\module') # Absolute path The one to use depends on the conditions you are running under: if your script is in some (for Blender) dedicated scripts folder, you could use the first one. If you run it from (for example) a Program Files folder, use the absolute path. share|improve this answer answered Oct 25 '11 at 9:37 jro 6,6681528 Fantastic - that solution works. Thanks very much –JimFing Oct 25 '11 at 9:41 add a comment| up vote 1 down vote Another thing that worked for me was running my python script with the following terminal command /usr/local/bin/python2.7 path/to/script.py share|improve this answer answered Jan 26 '12 at 5:03 Ricky 8,32121916 add a comment| up vote 0 down vote Another cliche I use when I h