Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils #12016

Closed
Arlan2191 opened this issue Sep 22, 2018 · 9 comments

Comments

@Arlan2191
Copy link

Arlan2191 commented Sep 22, 2018

I was running the the command from the install.rst.txt in Basic Installation inside the Anaconda Prompt. I have Visual Studio Build Tools installed and my python version I'm using is 3.6 and in a x64 bit. All this for the error, I got about the mtrand.pyx Value Error: a must be non-empty which was involved with me using np.random.choice. I ask your help cause it was said in other issues is to fix numpy but I didnt know it would involve to like download this entire repository. Help me please bit of a beginner.

This was the command:

python setup.py build -j 4 install --prefix $%HOME%/.local

It produced this error message.

Running from numpy source directory.
Cythonizing sources
numpy/random\mtrand\randint_helpers.pxi.in has not changed
numpy/random\mtrand\mtrand.pyx has not changed
blas_opt_info:
blas_mkl_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries mkl_rt not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

blis_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries blis not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

openblas_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries openblas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Could not locate executable DF
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize G95FCompiler
Could not locate executable g95
customize IntelEM64VisualFCompiler
customize IntelEM64TFCompiler
Could not locate executable efort
Could not locate executable efc
customize PGroupFlangCompiler
Could not locate executable flang
don't know how to compile Fortran code on platform 'nt'
  NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

atlas_3_10_blas_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

atlas_blas_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

accelerate_info:
  NOT AVAILABLE

F:\Anaconda\numpy-master\numpy-master\numpy\distutils\system_info.py:626: 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.
  self.calc_info()
blas_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries blas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

F:\Anaconda\numpy-master\numpy-master\numpy\distutils\system_info.py:626: 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.
  self.calc_info()
blas_src_info:
  NOT AVAILABLE

F:\Anaconda\numpy-master\numpy-master\numpy\distutils\system_info.py:626: 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.
  self.calc_info()
  NOT AVAILABLE

non-existing path in 'numpy\\distutils': 'site.cfg'
lapack_opt_info:
lapack_mkl_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries mkl_rt not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

openblas_lapack_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries openblas not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

openblas_clapack_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries openblas,lapack not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas,tatlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas,tatlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries tatlas,tatlas not found in F:\Anaconda\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  NOT AVAILABLE

atlas_3_10_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas,satlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas,satlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries satlas,satlas not found in F:\Anaconda\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries ptf77blas,ptcblas,atlas not found in F:\Anaconda\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
  NOT AVAILABLE

atlas_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\lib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in C:\
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries f77blas,cblas,atlas not found in F:\Anaconda\libs
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack_atlas not found in F:\Anaconda\libs
<class 'numpy.distutils.system_info.atlas_info'>
  NOT AVAILABLE

lapack_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries lapack not found in ['F:\\Anaconda\\lib', 'C:\\', 'F:\\Anaconda\\libs']
  NOT AVAILABLE

F:\Anaconda\numpy-master\numpy-master\numpy\distutils\system_info.py:626: 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.
  self.calc_info()
lapack_src_info:
  NOT AVAILABLE

F:\Anaconda\numpy-master\numpy-master\numpy\distutils\system_info.py:626: 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.
  self.calc_info()
  NOT AVAILABLE
@rgommers
Copy link
Member

You need a BLAS/LAPACK installed (MKL or ATLAS or OpenBLAS) is what those NOT AVAILABLE messages mean. I strongly suggest not trying to build numpy from source on Windwos, but install with conda instead.

@bharat-rb-panchal
Copy link

Getting same error: No module named 'numpy.distutils._msvccompiler' in numpy.distutils with Python 3.8.0. Please suggest.

@mattip
Copy link
Member

mattip commented Oct 22, 2019

Python 3.8 is not officially supported by NumPy yet. We strongly suggest you stick with python 3.7 for now, until you see a 3.8 designation in the "Programming Language" section of the PyPI numpy page (probably several weeks) or until an Anaconda release with Python 3.8 is available (probably several months)

@charris
Copy link
Member

charris commented Oct 22, 2019

Python 3.8 is supported by 1.17.3.

@mattip
Copy link
Member

mattip commented Oct 22, 2019

xref gh-14758

@netokey
Copy link

netokey commented Oct 23, 2019

Getting same error: No module named 'numpy.distutils._msvccompiler' in numpy.distutils with Python 3.8.0. Please suggest.

Same problem

@bharat-rb-panchal
Copy link

Uninstalled Python 3.8.0 and installed 3.7.0. It is working with 3.7.0. Thanks Matti.

@sauravmahuri2007
Copy link

I faced the same issue while installing scikit-learn. I'm using python3.8.0 with pip==19.3.1 and numpy==1.17.4 all latest at this time in Windows 10.

I was able to fix it by installing two visual studio dist packages:

  1. Download Visual C++ Build Tools installer and install it from here: http://go.microsoft.com/fwlink/?LinkId=691126&fixForIE=.exe

  2. Go to this link and download the setup and install Visual C++ Redistributable for Visual Studio 2015: https://www.microsoft.com/en-in/download/details.aspx?id=48145

Try to install the required python packages once again. Though I used pip for package installation, but I believe it should work for conda as well.

@mattip
Copy link
Member

mattip commented Nov 19, 2019

This issue is closed, the hints here are not really helpful. Downloading a compiler is an anti-pattern, you do not want to build numpy, only use it. Locking the thread.

@numpy numpy locked as resolved and limited conversation to collaborators Nov 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants