0
votes

I am relatively new to python and I was planning to use a module for iTunes in python, specifically this one https://github.com/robertf224/pyTunes and it shows that it has installed, but whenever i try to import the library into python, it shows no module is found. this is a picture of the errors and terminal

EDIT: Ok, so i have followed your instructions and it still does not seem to work. so this is the terminal:

Jeremys-iMac:~ Jeremy$ sudo pip3 install tunes Password:

The directory '/Users/Jeremy/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/Jeremy/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting tunes Downloading tunes-1.0.tar.gz Installing collected packages: tunes Running setup.py install for tunes ... done Successfully installed tunes-1.0 Jeremys-iMac:~ Jeremy$ Jeremys-iMac:~ Jeremy$ sudo python3 -m pip install tunes The directory '/Users/Jeremy/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/Jeremy/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Requirement already satisfied: tunes in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

and this is the python idle:

import tunes
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import tunes
ImportError: No module named 'tunes'
>>> import pytunes
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import pytunes
ImportError: No module named 'pytunes'
>>> import pyTunes
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import pyTunes
ImportError: No module named 'pyTunes'
>>> import tunes
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    import tunes
ImportError: No module named 'tunes'
>>> import tunes
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    import tunes
ImportError: No module named 'tunes'
>>> 
1
You used pip to install, which installs to Python 2.7, and then tried to import in Python 3. You want to install with pip3 to install in your Python 3 install. Also, never post pictures of text; post the text in your question. Search engines can't index the text in your picture, and a lot of question readers will skip your question rather than load the picture to figure it out. - Dan Lowe
next time, please post code and logs as text instead of as an image. - Corey Goldberg
ok, thank you for your advice, i will try to keep it in mind the next time i ask a question. - Jordan Francis

1 Answers

2
votes

You've installed the module under python 2.7, but you're trying to import it in python 3.5

So you would need to either import it from python 2.7 or use the pip corresponding to the python that (idle?) uses