您的位置:首页 > 编程语言 > Python开发

配置python环境

2015-08-14 21:08 260 查看
1、下载python3.4,mac版本,双击即可安装

2、安装pip,这里气的吐血,如下

2.1 pip下成7.0.6,和python3.4不合,官网上下载的时7.0.6, 这里本地需要 是7.1.0

2.1 下载之后要进行安装, 命令行如下

sudo python /Users/fishmai/Downloads/pip-7.1.0/setup.py install
running install
结果如下

Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating pip.egg-info
writing requirements to pip.egg-info/requires.txt
writing pip.egg-info/PKG-INFO
writing top-level names to pip.egg-info/top_level.txt
writing dependency_links to pip.egg-info/dependency_links.txt
writing entry points to pip.egg-info/entry_points.txt
writing manifest file 'pip.egg-info/SOURCES.txt'
warning: manifest_maker: standard file 'setup.py' not found

reading manifest file 'pip.egg-info/SOURCES.txt'
writing manifest file 'pip.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-intel/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

creating build
creating build/bdist.macosx-10.10-intel
creating build/bdist.macosx-10.10-intel/egg
creating build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/PKG-INFO -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/SOURCES.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/dependency_links.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/entry_points.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/not-zip-safe -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/requires.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying pip.egg-info/top_level.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
creating dist
creating 'dist/pip-7.1.0-py2.7.egg' and adding 'build/bdist.macosx-10.10-intel/egg' to it
removing 'build/bdist.macosx-10.10-intel/egg' (and everything under it)
Processing pip-7.1.0-py2.7.egg
removing '/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg' (and everything under it)
creating /Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg
Extracting pip-7.1.0-py2.7.egg to /Library/Python/2.7/site-packages
pip 7.1.0 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg
Processing dependencies for pip==7.1.0
Finished processing dependencies for pip==7.1.0
这里

writing entry points to pip.egg-info/entry_points.txt
writing manifest file 'pip.egg-info/SOURCES.txt'
这两部神奇般的需要超久的时间
3、安装xlrd,又是一堆不成功
命令行如下
sudo python -m pip xlrd
没有什么问题吧,运行结果如下

/usr/bin/python: No module named pip
fishmaideiMac:~ fishmai$ pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==7.1.0', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named pip
fishmaideiMac:~ fishmai$ pip2
Traceback (most recent call last):
File "/usr/local/bin/pip2", line 9, in <module>
load_entry_point('pip==7.1.0', 'console_scripts', 'pip2')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named pip
直接晕菜了,还以为是pip模块没有呢,一直在这里绕不出来
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: