Python: 安装lz4-0.10.1痛苦经历

在项目中需要安装lz4-0.10.1,但已有的1.1.0版本导致安装困难。经过一系列尝试,包括升级、卸载、安装不同版本,最终发现是某个库版本过旧的问题。解决方法是更新该库到最新版本,成功安装lz4-0.10.1。
摘要由CSDN通过智能技术生成

因为项目的需求,要 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 (
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值