ValueError“预期版本规范";通过点子安装本地车轮时 [英] ValueError "Expected version spec" when installing local wheel via pip

查看:84
本文介绍了ValueError“预期版本规范";通过点子安装本地车轮时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在开发的开源Python模块,并希望与工作场所的人们共享.我已经通过setup.py bdist_wheel用这个setup.py文件构建了一个轮子:

I have a closed-source Python module I am developing and would like to share with people in my workplace. I have built a wheel via setup.py bdist_wheel with this setup.py file:

#!/usr/bin/env python

from setuptools import setup, find_packages

setup(name='mypkg',
      version='0.0.1',
      description='tools for work',
      author='tbhartman',
      packages=find_packages('src', exclude=['test*']),
      package_dir = {'':'src'},
      entry_points={
          'console_scripts':[
              'runtool = mypkg.run:main',
              ],
          },
      install_requires = ['argparse'],
      classifiers = [
          'Development Status :: 3 - Alpha',
          'Programming Language :: Python :: 2',
          ]
     )

我想测试安装过程,所以我尝试 点安装dist \ mypkg-0.0.1-py2-none-any.whl 并获得以下回溯:

I want to test the installation process, so I try pip install dist\mypkg-0.0.1-py2-none-any.whl and get the following traceback:

Exception:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 139, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\commands\install.py", line 235, in run
    InstallRequirement.from_line(name, None))
  File "C:\Python27\lib\site-packages\pip\req.py", line 118, in from_line
    return cls(req, comes_from, url=url)
  File "C:\Python27\lib\site-packages\pip\req.py", line 43, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "build\bdist.win32\egg\pkg_resources\__init__.py", line 2929, in parse
    reqs = list(parse_requirements(s))
  File "build\bdist.win32\egg\pkg_resources\__init__.py", line 2876, in parse_requirements
    "version spec")
  File "build\bdist.win32\egg\pkg_resources\__init__.py", line 2841, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'dist/mypkg-0.0.1-py2-none-any.whl', 'at', '/mypkg-0.0.1-py2-none-any.whl')

Storing complete log in C:\Users\tbhartman\pip\pip.log

问题出在哪里,我该如何解决?

What is the problem and how to I fix it?

推荐答案

我使用的PIP版本太旧了.

I was using a very out-of-date version of PIP.

$ pip -V
pip 1.3.1 from C:\Python27\lib\site-packages (python 2.7)

我升级到了pip 6.0.8,一切都很好.

I upgraded to pip 6.0.8 and all is well.

这篇关于ValueError“预期版本规范";通过点子安装本地车轮时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆