如何通过终端

时间:2016-08-08 23:55:10

标签: python google-api

我试图使用终端和

安装google-api-python-client软件包
pip install --upgrade google-api-python-client

的结果相同
sudo -H  pip install --upgrade google-api-python-client

我也发现,有人建议使用这种方法:

sudo chown -R zkid18 /Users/zkid18/Library/Logs/pip
chown: /Users/zkid18/Library/Logs/pip: No such file or directory

sudo chown -R zkid18 /Users/zkid18/Library/Cashes/pip
chown: /Users/zkid18/Library/Cashes/pip: No such file or directory

同样的结果,当我通过Pycharm安装时 我的例外

例外: Traceback(最近一次调用最后一次):   文件“/Library/Python/2.7/site-packages/pip/basecommand.py”,第215行,主要     status = self.run(options,args)   文件“/Library/Python/2.7/site-packages/pip/commands/install.py”,第317行,在运行中     PREFIX = options.prefix_path,   安装文件“/Library/Python/2.7/site-packages/pip/req/req_set.py”,第736行     requirement.uninstall(auto_confirm =真)   在卸载文件“/Library/Python/2.7/site-packages/pip/req/req_install.py”,第742行     paths_to_remove.remove(auto_confirm)   文件“/Library/Python/2.7/site-packages/pip/req/req_uninstall.py”,第115行,删除     重命名(path,new_path)   文件“/Library/Python/2.7/site-packages/pip/utils/init.py”,第267行,重命名     shutil.move(旧的,新的)   文件“/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”,第302行,移动     copy2(src,real_dst)   在copy2中输入文件“/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”,第131行     copystat(src,dst)   在copystat中输入文件“/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”,第103行     os.chflags(dst,st.st_flags) OSError:[Errno 1]不允许操作:'/ tmp / tip-uxDRkx-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7。蛋信息“

1 个答案:

答案 0 :(得分:0)

使用virtualenv安装

virtualenv temp
source temp/bin/activate
pip install --upgrade google-api-python-client

或忽略六<​​/ p>

sudo pip install --upgrade google-api-python-client --ignore-installed six