If I run a Python script in Python it works PERFECTLY; however, adding this identical script inside the scripting window of Blender produces a constant error - Import Error: No module named ‘Phidgets’. I have spent over a week on this issue with no success. I have searched here and have found lots of identical questions (“Import Error: No module named ‘*”) but workable solutions are missing. I am using Python 3.3 and Blender 2.68. Please, experienced Blender/Python users, help.
Background: I am attempting to use a Phidgets Pressure Sensor to control the scale/size of an object. The Python code for the sensor works great and provides an output every time a pressure change occurs. I want to capture this pressure change and use it to change the object’s scale within Blender yet the 'Import Error: No module named ‘Phidgets’ is preventing this from working. How do I go about correcting this?
Sincerely,
Daryl G
CoDEmanX,
Could you further define what you mean by placing those files into the “appropriate folders” in my blender directory? What is an appropriate folder? Should not the commands ‘from’ and ‘import’ find the named modules in the Blender console just as it does within the Python module? Again, it works perfectly in the Python module but fails in Blender… there is a plethora of other threads regarding the same type of problem but no valid answers. Both are 64-bit loads.
Thanks,
Daryl G
Atom,
Thanks for the reply and link. I followed the directions of the link and when I amend my scripting to the same type (with the proper location of the files, DIRECTLY from my computer), Blender comes back with the same identical error. I will probably move on to another program because it looks as if Blender cannot properly synchronize with Phidgets… which is a requirement for my project.
Thanks,
Daryl G
That’s cool and super useful. I was wondering where you add something more to the path or at least thought that a good follow up question to provide that information here. I guess I am looking for the obvious startup scripts (Revealed in the path result scripts\startup) as opposed to doing this sys.path.append(module_dir) . I think you are suppose to be able to set an Environment variable
import os
os.environ[‘PYTHONPATH’]
‘/home/my_user/code’
But I am uncertain Blender respects that.
Okay well I guess you are suppose to put the append() command in a startup script. If there’s another way let us know, thanks.