Search code examples
pythonpipdistutils

Why is pip trying to install ctypes?


I've tried creating a simple little package and uploaded it to PyPi. When I try to install it however, pip tries to download and install ctypes (and fails at compiling it..):

(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 -..

I'm using Python 2.6.6 in a virtual env, so any ctypes requirement should already be satisfied:

(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'

The first version of my setup.py file listed it as a requirement, but the current version does not:

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

what am I doing wrong?


Solution

  • Did you upload the new version? It looks like pip is installing the older version (with the ctypes dep) that you mention. Try passing -v arguments to get more verbose output.