1

With Mac 10.13.2,PyCharm 2017.3(community edition),Python 3.6.4:

I've been searching high and low but with no luck as whatever I tried didn't work.I have installed Python 3.6 and PyCharm with a success,but it was driving me crazy when I installed the moduletime,PyBluezand openpyxl in the PyCharm.

Can't install time module The answer to the time package is that The time module is part of Python's standard library. It's installed along with the rest of Python, and you don't need to (nor can you!) install it with pip.

The error warning info when I installed the PyBluez module is always the same as follows:

PermissionError: [Errno 13] Permission denied: '/Users/ringo/Library/Caches/pip/wheels/e7/40/9d/b772a3cf2ca121e87a06eabe9483271816581dec7c772272d3'

error info screenshot for install PyBluez

When it occurred,I changed to install it in the terminal app with the command sudo pip3 install PyBluez

The error info: Failed building wheel for PyBluez

Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-umoukn9i/PyBluez/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-53lcxusy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-umoukn9i/PyBluez/

Install openpyxl: After I installed openpyxl in the terminal app with sudo pip3 install openpyxl,I re-open a PyCharm project,but the module isn't in the packege list.When I import openpyxl and run the project, the info ModuleNotFoundError: No module named 'openpyxl'occurs.

If I install it with PyCharm,the error message is the same as that when install PyBluez no openpyxl

How to solve the issues? It requires me to swipe before I can continue so it slows me down... I will be really grateful if you could share some right method that I should look into. Thanks.

Ringo
  • 1,173
  • 1
  • 12
  • 25

2 Answers2

1

Add further infomation:

Cannot import Bluetooth in Python 3 (OSX)With this question asked by Carl Bratt,I found the answer:

This is the closed OS X import issue #108 on GitHub: http://github.com/karulis/pybluez/issues/108

It's actually quite an old issue.

One thing the author suggested you might do is remove your current installation and install the GitHub repo using pip:

git clone https://github.com/karulis/pybluez.git pip install -e pybluez

Another command you can use:

pip3 install --upgrade git+https://github.com/rgov/pybluez.git#egg=pybluez

Ringo
  • 1,173
  • 1
  • 12
  • 25
0

try to install anaconda3 instead of python itself https://www.anaconda.com/download/#macos I'm using anaconda for python

  • Ok,thanks,I will go to learn what's anaconda3 and how to use it. – Ringo Dec 24 '17 at 15:37
  • `The following packages are not available from current channels:- pybluez` It seems that anaconda doesn't support the package `PyBluez` that is used for Bluetooth programming.So maybe I still need to use PyCharm. – Ringo Dec 25 '17 at 00:03