简体   繁体   English

通过pip安装本地车轮时出现ValueError“预期版本规格”

[英]ValueError “Expected version spec” when installing local wheel via pip

I have a closed-source Python module I am developing and would like to share with people in my workplace. 我有一个正在开发的开源Python模块,并希望与工作场所的人们共享。 I have built a wheel via setup.py bdist_wheel with this setup.py file: 我已经使用setup.py文件通过setup.py bdist_wheel构建了一个转轮:

#!/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',
          ]
     )

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: 我想测试安装过程,所以我尝试pip install dist \\ mypkg-0.0.1-py2-none-any.whl并获得以下回溯:

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? 有什么问题,我该如何解决?

I was using a very out-of-date version of PIP. 我使用的是PIP的过时版本。

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

I upgraded to pip 6.0.8 and all is well. 我升级到pip 6.0.8 ,一切都很好。

在AWS上使用Ubuntu 14.04 AMI,我发现我必须升级setuptools

sudo pip3 install -vU setuptools

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 点击错误“ValueError:('缺少分发规范','==')”在ubuntu服务器上安装pandas时 - pip error “ValueError: ('Missing distribution spec', '==')” when installing pandas on ubuntu server 通过 pip 安装 medcat 时,torchvision 依赖的版本错误 - Version error of torchvision dependency when installing medcat via pip 通过pip安装psutil(wheel)作为依赖项时遇到麻烦 - Troubles while installing psutil (wheel) as a dependency via pip 使用Pip安装依赖项时的Heroku部署ValueError - Heroku deployment ValueError when installing dependencies with Pip 如何在Windows上使用pip install修复错误“预期的版本规范...” - How to fix error “Expected version spec in …” using pip install on Windows? 引发ValueError(“ Expected” + item_name +” in”,line,“ at”,line [p:])ValueError:('Expected version spec in','django〜= 1.9.0','at','〜= 1.9.0') - raise ValueError(“Expected ”+item_name+“ in”,line,“at”,line[p:]) ValueError: ('Expected version spec in', 'django~=1.9.0', 'at', '~=1.9.0') 在没有Conda的情况下安装PyTorch时出现不支持的车轮错误 - Unsupported Wheel Error when pip installing PyTorch without Conda Python PIP 安装 Ray 时出现问题 - 车轮 package 不可用 - Python PIP issue when installing Ray - The wheel package is not available 从源代码安装 pip 时未构建 Wheel - 导致 ModuleNotFoundError - Wheel not built when pip installing from source - causes ModuleNotFoundError 在Windows 7上通过Pip安装Ansible。 - Installing Ansible via Pip on Windows 7. Getting ValueError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM