1

I am starting with python recently and I am trying to get the hang of the modules and libraries. So I have one script which has the following line

from pybluez import bluetooth 

So I looked for this library and downloaded from here https://github.com/karulis/pybluez and then tried to install it using this instructions http://www.instructables.com/id/How-to-install-Python-packages-on-Windows-7/

A friend of mine also suggested for me to copy the file of pybluez to C:\Users\Python27\Lib and I did it.

And in the end I am still getting this error when I run that script:

ImportError: No module named pybluez

Do you know how to solve this problem? I've already looked in forums but I can't get the right solution. Maybe I am missing some details but I don't know what..

Fatias7
  • 101
  • 2
  • 11

2 Answers2

1

use

 pip install PyBluez 

and then run the same code, it will run. And if you don't know about pip,just google it on or go to this http://pythonprogramming.net/using-pip-install-for-python-modules/

Hoping it will help you.

  • I tried to do that and it gives me **Requirement already satisfied : pybluez in c:\python27\lib\site-packages\pybluez-0.22-py2.7-win32.egg** So I suppose that the previous installation was correct no? Also, I tried one example of the github page and it worked on the command line but it still can't import when I am running Python in Spyder – Fatias7 Sep 13 '15 at 11:02
  • ok, right hm.. you may have then other problems too but begin with verifying your path environment variable, then look pip install --upgrade spyder and then pip install --upgrade PyBluez and then, and if still gets problem, then problem is because you have copied the folder, as in python some files are located not only in lib but also in scripts so you first have to uninstall PyBluez using pip uninstall PyBluez and install again using pip. I am 99% sure, the problem get solved. And thanks for comment... – Mohit Khurana Sep 14 '15 at 12:42
0

In python modules usually distributed using pip i suggest you to install it because if the module you are trying to install have dependencies pip will also handle that for you. You can install it like its described in here. After installing you can install the module you want like below. It is also explained in github page

pip install pybluez
DreadfulWeather
  • 716
  • 3
  • 13