ImportError: No module named 'bpy'
Asked Answered
M

1

6

I am getting Error ImportError: No module named 'bpy' in Blender console. I am importing bpy module inside Blender console but still getting the Error. After long Googling I found that no one is getting the same error inside Blender.

Using Blender 2.7 and python 3.4.

My code:

import sys   
import bpy     
sys.path.append("C:\Python34\Lib\site-packages")    
import serial    
import GameLogic    
contr = GameLogic.getCurrentController()    
own = contr.owner    
dane=open('dane.txt', 'rb')    
x=dane.read()    
dane.close()    
y = int(x)    
print ("y=", y)    

bpy.ops.transform.rotate(value=(y), axis=(0.0, 0.0, 0.0), constraint_axis=(False, False, False), constraint_orientation='', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.0, snap=False, snap_target='CLOSEST', snap_point=(0.0, 0.0, 0.0), snap_align=False, snap_normal=(0.0, 0.0, 0.0), release_confirm=False)    

Output at Blender console:

ImportError: No module named 'bpy'  
Python script error - object 'Cube', controller 'Python':  
Traceback (most recent call last):  
File "qqq.py", line 2, in <module>  
ImportError: No module named 'bpy'  
Minaminabe answered 29/10, 2014 at 10:55 Comment(1)
there is an answer over at the blender stackexchange community: blender.stackexchange.com/questions/5732/…Guimar
H
-2

I have this problem in collab but on my PC it was worked well:

enter image description here

type this in your anaconda prompt:

pip install bpy

Source: https://pypi.org/project/bpy/)

Heidy answered 9/3, 2021 at 11:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.