2011-05-24 98 views
25

在Windows上,我通常只使用二進制安裝程序,但我想只有在virtualenv中這段時間來安裝NumPy,所以我創建了一個虛擬的ENV:的Windows +的virtualenv +畫中畫+ NumPy的(安裝NumPy的問題時)

virtualenv --no-site-packages --distribute summary_python 
cd summary_python/Scripts 
activate.bat 

然後我試圖安裝NumPy的

pip install numpy 

我得到一個錯誤。我pip.log粘貼如下:

Downloading/unpacking numpy 
    Running setup.py egg_info for package numpy 
    non-existing path in 'numpy\\distutils': 'site.cfg' 
    F2PY Version 2 
    blas_opt_info: 
    blas_mkl_info: 
     libraries mkl,vml,guide not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries mkl,vml,guide not found in C:\ 
     NOT AVAILABLE 

    atlas_blas_threads_info: 
    Setting PTATLAS=ATLAS 
     libraries ptf77blas,ptcblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries ptf77blas,ptcblas,atlas not found in C:\ 
     NOT AVAILABLE 

    atlas_blas_info: 
     libraries f77blas,cblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries f77blas,cblas,atlas not found in C:\ 
     NOT AVAILABLE 

    blas_info: 
     libraries blas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries blas not found in C:\ 
     NOT AVAILABLE 

    blas_src_info: 
     NOT AVAILABLE 

     NOT AVAILABLE 

    lapack_opt_info: 
    lapack_mkl_info: 
    mkl_info: 
     libraries mkl,vml,guide not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries mkl,vml,guide not found in C:\ 
     NOT AVAILABLE 

     NOT AVAILABLE 

    atlas_threads_info: 
    Setting PTATLAS=ATLAS 
     libraries ptf77blas,ptcblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries lapack_atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries ptf77blas,ptcblas,atlas not found in C:\ 
     libraries lapack_atlas not found in C:\ 
    numpy.distutils.system_info.atlas_threads_info 
     NOT AVAILABLE 

    atlas_info: 
     libraries f77blas,cblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries lapack_atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries f77blas,cblas,atlas not found in C:\ 
     libraries lapack_atlas not found in C:\ 
    numpy.distutils.system_info.atlas_info 
     NOT AVAILABLE 

    lapack_info: 
     libraries lapack not found in c:\Users\fname.lname\Documents\summary_python\lib 
     libraries lapack not found in C:\ 
     NOT AVAILABLE 

    lapack_src_info: 
     NOT AVAILABLE 

     NOT AVAILABLE 

    running egg_info 
    running build_src 
    build_src 
    building py_modules sources 
    building library "npymath" sources 
    No module named msvccompiler in numpy.distutils; trying from distutils 
    Running from numpy source directory.c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:531: UserWarning: Specified path is invalid. 
     warnings.warn('Specified path %s is invalid.' % d) 
    c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1417: UserWarning: 
     Atlas (http://math-atlas.sourceforge.net/) libraries not found. 
     Directories to search for the libraries can be specified in the 
     numpy/distutils/site.cfg file (section [atlas]) or by setting 
     the ATLAS environment variable. 
     warnings.warn(AtlasNotFoundError.__doc__) 
    c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1426: UserWarning: 
     Blas (http://www.netlib.org/blas/) libraries not found. 
     Directories to search for the libraries can be specified in the 
     numpy/distutils/site.cfg file (section [blas]) or by setting 
     the BLAS environment variable. 
     warnings.warn(BlasNotFoundError.__doc__) 
    c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1429: UserWarning: 
     Blas (http://www.netlib.org/blas/) sources not found. 
     Directories to search for the sources can be specified in the 
     numpy/distutils/site.cfg file (section [blas_src]) or by setting 
     the BLAS_SRC environment variable. 
     warnings.warn(BlasSrcNotFoundError.__doc__) 
    c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1333: UserWarning: 
     Atlas (http://math-atlas.sourceforge.net/) libraries not found. 
     Directories to search for the libraries can be specified in the 
     numpy/distutils/site.cfg file (section [atlas]) or by setting 
     the ATLAS environment variable. 
     warnings.warn(AtlasNotFoundError.__doc__) 
    c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1344: UserWarning: 
     Lapack (http://www.netlib.org/lapack/) libraries not found. 
     Directories to search for the libraries can be specified in the 
     numpy/distutils/site.cfg file (section [lapack]) or by setting 
     the LAPACK environment variable. 
     warnings.warn(LapackNotFoundError.__doc__) 
    c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1347: UserWarning: 
     Lapack (http://www.netlib.org/lapack/) sources not found. 
     Directories to search for the sources can be specified in the 
     numpy/distutils/site.cfg file (section [lapack_src]) or by setting 
     the LAPACK_SRC environment variable. 
     warnings.warn(LapackSrcNotFoundError.__doc__) 
    error: Unable to find vcvarsall.bat 
    Complete output from command python setup.py egg_info: 
    non-existing path in 'numpy\\distutils': 'site.cfg' 

F2PY Version 2 

blas_opt_info: 

blas_mkl_info: 

    libraries mkl,vml,guide not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries mkl,vml,guide not found in C:\ 

    NOT AVAILABLE 



atlas_blas_threads_info: 

Setting PTATLAS=ATLAS 

    libraries ptf77blas,ptcblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries ptf77blas,ptcblas,atlas not found in C:\ 

    NOT AVAILABLE 



atlas_blas_info: 

    libraries f77blas,cblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries f77blas,cblas,atlas not found in C:\ 

    NOT AVAILABLE 



blas_info: 

    libraries blas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries blas not found in C:\ 

    NOT AVAILABLE 



blas_src_info: 

    NOT AVAILABLE 



    NOT AVAILABLE 



lapack_opt_info: 

lapack_mkl_info: 

mkl_info: 

    libraries mkl,vml,guide not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries mkl,vml,guide not found in C:\ 

    NOT AVAILABLE 



    NOT AVAILABLE 



atlas_threads_info: 

Setting PTATLAS=ATLAS 

    libraries ptf77blas,ptcblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries lapack_atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries ptf77blas,ptcblas,atlas not found in C:\ 

    libraries lapack_atlas not found in C:\ 

numpy.distutils.system_info.atlas_threads_info 

    NOT AVAILABLE 



atlas_info: 

    libraries f77blas,cblas,atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries lapack_atlas not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries f77blas,cblas,atlas not found in C:\ 

    libraries lapack_atlas not found in C:\ 

numpy.distutils.system_info.atlas_info 

    NOT AVAILABLE 



lapack_info: 

    libraries lapack not found in c:\Users\fname.lname\Documents\summary_python\lib 

    libraries lapack not found in C:\ 

    NOT AVAILABLE 



lapack_src_info: 

    NOT AVAILABLE 



    NOT AVAILABLE 



running egg_info 

running build_src 

build_src 

building py_modules sources 

building library "npymath" sources 

No module named msvccompiler in numpy.distutils; trying from distutils 

Running from numpy source directory.c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:531: UserWarning: Specified path is invalid. 

    warnings.warn('Specified path %s is invalid.' % d) 

c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1417: UserWarning: 

    Atlas (http://math-atlas.sourceforge.net/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [atlas]) or by setting 

    the ATLAS environment variable. 

    warnings.warn(AtlasNotFoundError.__doc__) 

c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1426: UserWarning: 

    Blas (http://www.netlib.org/blas/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [blas]) or by setting 

    the BLAS environment variable. 

    warnings.warn(BlasNotFoundError.__doc__) 

c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1429: UserWarning: 

    Blas (http://www.netlib.org/blas/) sources not found. 

    Directories to search for the sources can be specified in the 

    numpy/distutils/site.cfg file (section [blas_src]) or by setting 

    the BLAS_SRC environment variable. 

    warnings.warn(BlasSrcNotFoundError.__doc__) 

c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1333: UserWarning: 

    Atlas (http://math-atlas.sourceforge.net/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [atlas]) or by setting 

    the ATLAS environment variable. 

    warnings.warn(AtlasNotFoundError.__doc__) 

c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1344: UserWarning: 

    Lapack (http://www.netlib.org/lapack/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [lapack]) or by setting 

    the LAPACK environment variable. 

    warnings.warn(LapackNotFoundError.__doc__) 

c:\Users\fname.lname\Documents\summary_python\build\numpy\numpy\distutils\system_info.py:1347: UserWarning: 

    Lapack (http://www.netlib.org/lapack/) sources not found. 

    Directories to search for the sources can be specified in the 

    numpy/distutils/site.cfg file (section [lapack_src]) or by setting 

    the LAPACK_SRC environment variable. 

    warnings.warn(LapackSrcNotFoundError.__doc__) 

error: Unable to find vcvarsall.bat 

---------------------------------------- 
Command python setup.py egg_info failed with error code 1 
Exception information: 
Traceback (most recent call last): 
    File "c:\Users\fname.lname\Documents\summary_python\lib\site-packages\pip-1.0.1-py2.7.egg\pip\basecommand.py", line 126, in main 
    self.run(options, args) 
    File "c:\Users\fname.lname\Documents\summary_python\lib\site-packages\pip-1.0.1-py2.7.egg\pip\commands\install.py", line 223, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "c:\Users\fname.lname\Documents\summary_python\lib\site-packages\pip-1.0.1-py2.7.egg\pip\req.py", line 986, in prepare_files 
    req_to_install.run_egg_info() 
    File "c:\Users\fname.lname\Documents\summary_python\lib\site-packages\pip-1.0.1-py2.7.egg\pip\req.py", line 222, in run_egg_info 
    command_desc='python setup.py egg_info') 
    File "c:\Users\fname.lname\Documents\summary_python\lib\site-packages\pip-1.0.1-py2.7.egg\pip\__init__.py", line 255, in call_subprocess 
    % (command_desc, proc.returncode)) 
InstallationError: Command python setup.py egg_info failed with error code 1 

回答

46

我已經成功地將NumPy二進制文件安裝到virtualenv中,具有良好的'ol easy_install和一點存檔魔術。

SourceForge下載的numpy-1.x.x-win32-superpack-python2.x.exe發佈實際只是三個獨立的二進制分發版中的一個瘦包裝(與SSE3SSE2,或沒有啓用SSE,這取決於你的CPU的能力)。如果您打開7-Zip(或其他存檔實用程序)中的超級包EXE文件,則可以將這些單獨的安裝文件提取到某處以單獨使用。

然後,激活您的虛擬環境,並運行

easy_install c:\path\to\extracted\numpy-1.x.x-sse3.exe 

安裝SSE3優化的二進制文件,例如。 easy_install足夠聰明,可以在wininst包內找到所需的所有東西,並將編譯後的egg提取到您的virtualenv的site-packages文件夾中。我也可以確認當你這樣做時,pip仍然能夠識別和/或卸載NumPy,並且使用pip來安裝依賴於NumPy的其他軟件包工作得很好。

唯一的問題是知道使用哪個優化級別(SSE3,SSE2或no-SSE)。如果您有reasonably modern processor(比Pentium 4Athlon 64更新),則可以安全使用完整的SSE3。您也可以運行測試套件確認一切正常。


我已經找到了easy_install「絕招」是用於安裝各種二進制包成一個virtualenv中真正有用的。儘管我的計算機上已安裝了所有必需的編譯器,但在提供正式版本時,通常更容易/更快/更安全。

+0

爲了讓大熊貓工作,我不得不這樣做後,手動升級,但現在 所有工作「PIP安裝熊貓--upgrade」 – user913059 2015-10-19 10:33:26

4

由於PIP只能從源代碼安裝,你需要有安裝構建和編譯NumPy能夠使用PIP。我從來沒有試過這個。

我最近得到什麼與NumPy,SciPyMatplotlib到Windows上  7虛擬環境是對目錄和文件egg從我的常規的Python直接複製安裝到虛擬環境。對於Matplotlib,我還設法將二進制安裝程序直接解壓縮到virtualenv中(我只爲Python 3.2的Gohlke安裝程序嘗試過)。

我在過去曾經管理過將easy_install NumPy從二進制發行版本轉換成virtualenv,但是我這次沒有管理(NumPy 1.5.1)。

有人建議http://pypi.python.org/pypi/pyg應該允許從二進制包安裝到virtualenv,但我還沒有嘗試過。

+0

謝謝!我試着用PYG,並沒有運氣。我會定期檢查 – oob 2011-06-21 19:21:08

0

我沒有做拆包.exe文件的伎倆。我只是激活了我的虛擬環境,然後:

easy_install numpy 
+0

這真的一點,實在值得使用的virtualenv的額外費用,這是virtualenvwrapper。這很棒。所以我用「workon」命令激活它。這裏文檔 - > http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html#controlling-the-active-environment – miguelfg 2014-09-09 10:14:01