2013-02-03 369 views
1

我試過創建一個簡單的小包並將其上傳到PyPi。當我嘗試但是安裝它,PIP嘗試下載並安裝ctypes的(在編譯失敗..):爲什麼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 -.. 

我在虛擬ENV使用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'], 
    ... 

我究竟做錯了什麼?

回答

1

您上傳了新版本嗎?看起來pip正在安裝你提到的舊版本(帶有ctypes dep)。嘗試傳遞-v參數以獲得更詳細的輸出。

+0

謝謝。 -v參數告訴我,pip正在嘗試構建它之前下載的ctypes(但從未成功構建)。一旦我刪除了構建文件夾(包含一個名爲'pip-delete-this-directory.txt'的文件:-),一切都很順利。 – thebjorn

相關問題