我尝试创建一个简单的小包并将其上传到 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'],
...
我究竟做错了什么?