我尝试使用
为python安装peewee模块sudo pip install peewee但是当我运行我的脚本时仍然出现错误
sudo pip install peewee
[sudo] password for mounarajan:
The directory '/home/mounarajan/.cache/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 '/home/mounarajan/.cache/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 peewee
Downloading peewee-2.8.0.tar.gz (470kB)
100% |████████████████████████████████| 471kB 123kB/s
Installing collected packages: peewee
Running setup.py install for peewee ... done
Successfully installed peewee-2.8.0
试过这个python Interpreter
import peewee
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named peewee
答案 0 :(得分:3)
安装包时请勿使用“sudo”。
pip install peewee
答案 1 :(得分:-2)
有几个相关/重复的答案。但是我个人不小心使用sudo
来安装一些python包/公式,并且使用了这个权限。
$ brew doctor
是你的朋友。你会找到一些好的建议来解决你的问题。
另一个建议是使用virtualenv
进行python。谷歌提供您最喜欢的教程和使用它的文章。