Python学习之mac下PyCharm导入第三方包
2016-12-09 15:48
615 查看
最近对Python有兴趣,在网上搜了《八天深入理解python》视频教程,由于用的mac,不用安装python,感觉瞬间开发环境就已经具备了,然后连个ipython都没装上,ps:还是只刚入手mac的菜鸟。
在终端,使用:sudo pip install ipython
[plain] view
plain copy
print?
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
copytree(src, real_dst, symlinks=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]
报了一堆这样的错误
最后饶了一圈网上方法都说是系统保护(我还没对我的系统做过什么破坏性的事情)
按着:解除系统保护方法如下链接http://chaishiwei.com/blog/994.html
的方法试了好多次,电脑重启10来次,我就是没有实用工具,也是心累。
那么,改用PyCharm的IDE吧
问题来了:同样得导入第三方的包,别人都有file→setting,我这怎么就是没有。也是心累。
在这里记录一下,免得跟多人入坑
1、PyCharm→Preferences→Project:项目名→Project Interpreter
2、点击这个加号可以导入新的库,点击install,这里以requests库为例
3、查看是否已经存在
库已经导入了。
4、写个程序测试一下
[python] view
plain copy
print?
import requests
res=requests.get('https://www.baidu.com')
savefile=open("itcast.html","w")
savefile.write(res.content)
savefile.close()
生成文件并保存
原文地址:http://blog.csdn.net/zk673820543/article/details/52384134
在终端,使用:sudo pip install ipython
[plain] view
plain copy
print?
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
copytree(src, real_dst, symlinks=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/tmp/pip-xR59WP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]
报了一堆这样的错误
最后饶了一圈网上方法都说是系统保护(我还没对我的系统做过什么破坏性的事情)
按着:解除系统保护方法如下链接http://chaishiwei.com/blog/994.html
的方法试了好多次,电脑重启10来次,我就是没有实用工具,也是心累。
那么,改用PyCharm的IDE吧
问题来了:同样得导入第三方的包,别人都有file→setting,我这怎么就是没有。也是心累。
在这里记录一下,免得跟多人入坑
1、PyCharm→Preferences→Project:项目名→Project Interpreter
2、点击这个加号可以导入新的库,点击install,这里以requests库为例
3、查看是否已经存在
库已经导入了。
4、写个程序测试一下
[python] view
plain copy
print?
import requests
res=requests.get('https://www.baidu.com')
savefile=open("itcast.html","w")
savefile.write(res.content)
savefile.close()
生成文件并保存
原文地址:http://blog.csdn.net/zk673820543/article/details/52384134
相关文章推荐
- Python Pycharm导入第三方包
- pycharm集成IDE导入第三方python模块问题
- Python:Pycharm下无法导入安装好的第三方模块?
- Mac系统中python导入第三方模块成功,但是import python第三方模块失败解决方法
- python学习笔记之——python安装mysqldb后,pycharm导入还是报错问题
- Mac系统中python idle导入第三方模块成功,ecplise导入python第三方模块失败解决方法
- Eclipse导入pycharm或其他IDE中的PYTHON项目
- 【python第三方库学习】xlrd读取Excel文件
- Python学习_Python 3.X版本导入httplib模块报ImportError解决方案
- Python学习---BeautifulSoup安装(第三方模块)
- Python学习第三天(一个简单制作导入模块)
- Python第三方包的导入
- from ....import导入其他路径的模块 分类: python基础学习 2013-10-11 15:13 315人阅读 评论(0) 收藏
- python学习笔记 常用第三方模块
- Python 第三方 http 库-Requests 学习
- Python学习笔记-模块介绍(二)-模块导入和执行
- python安装第三方包之后无法导入相应模块(一个容易忽略的bug)
- 【转】Python 第三方 http 库-Requests 学习
- 【学习python】eclipse导入Flask报错,但程序执行正常
- python学习五:执行linux命令的两种方法、提高运行效率、进制转换、切片详解、ip和mac获取