Python模块无法正确安装mac

时间:2017-01-17 02:57:06

标签: python macos python-3.x

我对python比较陌生,我打算在python中使用iTunes模块,特别是这个https://github.com/robertf224/pyTunes,它表明它已安装,但每当我尝试将库导入python时,它显示没有找到模块。 this is a picture of the errors and terminal

修改 好的,所以我按照你的指示,它仍然似乎不起作用。 所以这是终端:

   Jeremys-iMac:~Jeremy $ sudo pip3 install tunes密码:

     

目录'/ Users / Jeremy / Library / Caches / pip / http'或其父目录   目录不归当前用户所有,并且缓存已经存在   禁用。请检查该目录的权限和所有者。如果   用sudo执行pip,你可能想要sudo的-H标志。目录   '/ Users / Jeremy / Library / Caches / pip'或其父目录不是   由当前用户拥有并且缓存轮已被禁用。校验   该目录的权限和所有者。如果执行pip   sudo,你可能想要sudo的-H标志。收集音乐下载   tunes-1.0.tar.gz安装收集的软件包:tunes Running   用于曲调的setup.py安装...已成功安装了tunes-1.0   Jeremys-iMac:~Jeremy $ Jeremys-iMac:~Jeremy $ sudo python3 -m pip   安装曲调目录'/ Users / Jeremy / Library / Caches / pip / http'或   其父目录不归当前用户和缓存所有   已被禁用。请检查权限和所有者   目录。如果用sudo执行pip,你可能需要sudo的-H标志。   目录'/ Users / Jeremy / Library / Caches / pip'或其父目录   目录不属于当前用户和缓存轮   禁用。检查该目录的权限和所有者。如果   用sudo执行pip,你可能想要sudo的-H标志。需求   已经满足:调整   /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

这就是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 个答案:

答案 0 :(得分:2)

您已经在python 2.7下安装了该模块,但是您尝试在python 3.5中导入它

所以你需要从python 2.7导入它或者使用与python相对应的pip(idle?)使用

相关问题