1

我尝试创建一个简单的小包并将其上传到 PyPi。但是,当我尝试安装它时,pip 会尝试下载并安装 ctypes(并且编译失败..):

(dev) C:\work\dev>pip install --upgrade dosbox-screen
Downloading/unpacking dosbox-screen
  Running setup.py egg_info for package dosbox-screen
Downloading/unpacking ctypes (from dosbox-screen)
  Running setup.py egg_info for package ctypes
    warning: no files found matching 'MANIFEST'
    warning: no files found matching 'NEWS.txt'
    warning: no files found matching 'ctypes\.CTYPES_DEVEL'
Downloading/unpacking colorama (from dosbox-screen)
  Running setup.py egg_info for package colorama
Installing collected packages: dosbox-screen, ctypes, colorama
  Running setup.py install for dosbox-screen
  Running setup.py install for ctypes
    building '_ctypes' extension
    error: Unable to find vcvarsall.bat
    Complete output from command C:\work\dev\Scripts\python.exe -..

我在虚拟环境中使用 Python 2.6.6,所以应该已经满足任何 ctypes 要求:

(dev) C:\work\dev>python
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.__file__
'c:\\python26\\Lib\\ctypes\\__init__.pyc'

我的 setup.py 文件的第一个版本将其列为要求,但当前版本没有:

setup(
    name='dosbox-screen',
    version='0.0.3',
    requires=['colorama'],
    install_requires=['colorama'],
    ...

我究竟做错了什么?

4

1 回答 1

1

你上传新版本了吗?看起来 pip 正在安装您提到的旧版本(使用 ctypes dep)。尝试传递 -v 参数以获得更详细的输出。

于 2013-02-05T16:22:34.643 回答