Python安装安装lz4-0.10.1遇到的坑遇到的坑
本篇文章给大家分享了Python安装lz4-0.10.1的详细过程以及遇到的坑,需要的读者们参考下。
因为项目的需求,要 lz4.0.10.1 的,因为本机已经有一个 1.1.0 版本的,所以必须先卸掉,然后我差点没疯了(手动微笑)
sudo pip uninstall lz4
Uninstalling lz4-1.1.0:
/Library/Python/2.7/site-packages/lz4-1.1.0-py2.7.egg-info
/Library/Python/2.7/site-packages/lz4/__init__.py
/Library/Python/2.7/site-packages/lz4/__init__.pyc
/Library/Python/2.7/site-packages/lz4/block/__init__.py
/Library/Python/2.7/site-packages/lz4/block/__init__.pyc
/Library/Python/2.7/site-packages/lz4/frame/__init__.py
/Library/Python/2.7/site-packages/lz4/frame/__init__.pyc
/Library/Python/2.7/site-packages/lz4/frame/_compression.py
/Library/Python/2.7/site-packages/lz4/frame/_compression.pyc
/Library/Python/2.7/site-packages/lz4/version.py
/Library/Python/2.7/site-packages/lz4/version.pyc
Proceed (y/n)? y
Successfully uninstalled lz4-1.1.0
准备愉快地装上 0.10.1
sudo pip install lz4==0.10.1
Collecting lz4==0.10.1
Downloading https://files.pythonhosted.org/packages/f5/c6/ef2890b5e287735576e15c1389aa0b9032c9d78ed72385fbd1149af593cd/lz4-0.10.1.tar.gz (92kB)
100% |████████████████████████████████| 92kB 1.8MB/s
Complete output from command python setup.py egg_info:
Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
No local packages or download links found for setuptools-scm
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-0IKxUP/lz4/setup.py", line 180, in <module>
'Programming Language :: Python :: 3.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 221, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 825, in best_match
return self.obtain(req, installer) # try and download/install
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 837, in obtain
return installer(requirement)
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 294, in fetch_build_egg
return cmd.easy_install(req)
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/command/easy_install.py", line 592, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm')
咦,需要装这个包setuptools-scm,直接无脑装
sudo pip install setuptools-scm
Collecting setuptools-scm
Downloading https://files.pythonhosted.org/packages/4d/a0/371355cbd608ef1d865738b94f7681e2fe56ef951070a66a892f30042a86/setuptools_scm-2.1.0-py2.py3-none-any.whl
Installing collected packages: setuptools-scm
Successfully installed setuptools-scm-2.1.0
继续装我的 lz4
sudo pip install lz4==0.10.1
Collecting lz4==0.10.1
Downloading https://files.pythonhosted.org/packages/f5/c6/ef2890b5e287735576e15c1389aa0b9032c9d78ed72385fbd1149af593cd/lz4-0.10.1.tar.gz (92kB)
100% |████████████████████████████████| 92kB 2.0MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-Cc2Av_/lz4/setup.py", line 180, in <module>
'Programming Language :: Python :: 3.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 258, in finalize_options
ep.load()(self, ep.name, value)
File "/Library/Python/2.7/site-packages/setuptools_scm/integration.py", line 10, in version_keyword
_warn_if_setuptools_outdated()
File "/Library/Python/2.7/site-packages/setuptools_scm/version.py", line 44, in _warn_if_setuptools_outdated
warnings.warn("your setuptools is too old (<12)", SetuptoolsOutdatedWarning)
setuptools_scm.version.SetuptoolsOutdatedWarning: your setuptools is too old (<12)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Cc2Av_/lz4/
我天。。隐约察觉到有点不对劲,这什么鬼。。 too old ?? 所以要我先升级下?
sudo pip install --upgrade setuptools
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/8c/10/79282747f9169f21c053c562a0baa21815a8c7879be97abd930dbcf862e8/setuptools-39.1.0-py2.py3-none-any.whl (566kB)
100% |████████████████████████████████| 573kB 1.6MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 18.5
Uninstalling setuptools-18.5:
Successfully uninstalled setuptools-18.5
Successfully installed setuptools-39.1.0
这次没毛病了吧? 装我的 lz4
sudo pip install lz4==0.10.1
Collecting lz4==0.10.1
Downloading https://files.pythonhosted.org/packages/f5/c6/ef2890b5e287735576e15c1389aa0b9032c9d78ed72385fbd1149af593cd/lz4-0.10.1.tar.gz (92kB)
100% |████████████████████████████████| 92kB 1.1MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-ML2zwz/lz4/setup.py", line 180, in <module>
'Programming Language :: Python :: 3.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 258, in finalize_options
ep.load()(self, ep.name, value)
File "/Library/Python/2.7/site-packages/setuptools_scm/integration.py", line 10, in version_keyword
_warn_if_setuptools_outdated()
File "/Library/Python/2.7/site-packages/setuptools_scm/version.py", line 44, in _warn_if_setuptools_outdated