《Python笔记》安装(pip)第三方包报错

2023-11-06

Python版本

$ python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

报错信息

pip 安装numpy报错

在这里插入图片描述

$ pip install numpy
Looking in indexes: 
Collecting numpy
  Using cached /numpy-1.22.4.zip
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517) ... error
  Complete output from command 
  Processing numpy/random\_bounded_integers.pxd.in
  Processing numpy/random\bit_generator.pyx
  Processing numpy/random\mtrand.pyx
  Processing numpy/random\_bounded_integers.pyx.in
  Processing numpy/random\_common.pyx
  Processing numpy/random\_generator.pyx
  Processing numpy/random\_mt19937.pyx
  Processing numpy/random\_pcg64.pyx
  Processing numpy/random\_philox.pyx
  Processing numpy/random\_sfc64.pyx
  Cythonizing sources
  INFO: blas_opt_info:
  INFO: blas_armpl_info:
  INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  INFO: customize MSVCCompiler
  INFO:   libraries armpl_lp64_mp not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: blas_mkl_info:
  INFO:   libraries mkl_rt not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: blis_info:
  INFO:   libraries blis not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: openblas_info:
  INFO:   libraries openblas not found in ['\\lib', 'C:\\']
  INFO: get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
  INFO: customize GnuFCompiler
  WARN: Could not locate executable g77
  WARN: Could not locate executable f77
  INFO: customize IntelVisualFCompiler
  WARN: Could not locate executable ifort
  WARN: Could not locate executable ifl
  INFO: customize AbsoftFCompiler
  WARN: Could not locate executable f90
  INFO: customize CompaqVisualFCompiler
  INFO: Found executable C:\Program Files\Git\usr\bin\DF.exe
  WARN: Could not locate executable C:\Program
  INFO: customize IntelItaniumVisualFCompiler
  WARN: Could not locate executable efl
  INFO: customize Gnu95FCompiler
  WARN: Could not locate executable gfortran
  WARN: Could not locate executable f95
  INFO: customize G95FCompiler
  WARN: Could not locate executable g95
  INFO: customize IntelEM64VisualFCompiler
  INFO: customize IntelEM64TFCompiler
  WARN: Could not locate executable efort
  WARN: Could not locate executable efc
  INFO: customize PGroupFlangCompiler
  WARN: Could not locate executable flang
  WARN: don't know how to compile Fortran code on platform 'nt'
  INFO:   NOT AVAILABLE
  INFO:
  INFO: accelerate_info:
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_3_10_blas_threads_info:
  INFO: Setting PTATLAS=ATLAS
  INFO:   libraries tatlas not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_3_10_blas_info:
  INFO:   libraries satlas not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_blas_threads_info:
  INFO: Setting PTATLAS=ATLAS
  INFO:   libraries ptf77blas,ptcblas,atlas not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_blas_info:
  INFO:   libraries f77blas,cblas,atlas not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: blas_info:
  INFO:   libraries blas not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: blas_src_info:
  INFO:   NOT AVAILABLE
  INFO:
  INFO:   NOT AVAILABLE
  INFO:
  non-existing path in 'numpy\\distutils': 'site.cfg'
  INFO: lapack_opt_info:
  INFO: lapack_armpl_info:
  INFO:   libraries armpl_lp64_mp not found in ['\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: lapack_mkl_info:
  INFO:   libraries mkl_rt not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: openblas_lapack_info:
  INFO:   libraries openblas not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: openblas_clapack_info:
  INFO:   libraries openblas,lapack not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: flame_info:
  INFO:   libraries flame not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_3_10_threads_info:
  INFO: Setting PTATLAS=ATLAS
  INFO:   libraries tatlas,tatlas not found in \lib
  INFO:   libraries tatlas,tatlas not found in C:\
  INFO: <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_3_10_info:
  INFO:   libraries satlas,satlas not found in \lib
  INFO:   libraries satlas,satlas not found in C:\
  INFO: <class 'numpy.distutils.system_info.atlas_3_10_info'>
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_threads_info:
  INFO: Setting PTATLAS=ATLAS
  INFO:   libraries ptf77blas,ptcblas,atlas not found in \lib
  INFO:   libraries ptf77blas,ptcblas,atlas not found in C:\
  INFO: <class 'numpy.distutils.system_info.atlas_threads_info'>
  INFO:   NOT AVAILABLE
  INFO:
  INFO: atlas_info:
  INFO:   libraries f77blas,cblas,atlas not found in \lib
  INFO:   libraries f77blas,cblas,atlas not found in C:\
  INFO: <class 'numpy.distutils.system_info.atlas_info'>
  INFO:   NOT AVAILABLE
  INFO:
  INFO: lapack_info:
  INFO:   libraries lapack not found in ['\\lib', 'C:\\']
  INFO:   NOT AVAILABLE
  INFO:
  INFO: lapack_src_info:
  INFO:   NOT AVAILABLE
  INFO:
  INFO:   NOT AVAILABLE
  INFO:
  INFO: numpy_linalg_lapack_lite:
  INFO:   FOUND:
  INFO:     language = c
  INFO:     define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]
  INFO:
  running bdist_wheel
  running build
  running config_cc
  INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  running config_fc
  INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  INFO: build_src
  INFO: building py_modules sources
  creating build
  creating build\src.win-amd64-3.8
  creating build\src.win-amd64-3.8\numpy
  creating build\src.win-amd64-3.8\numpy\distutils
  INFO: building library "npymath" sources
  Running from numpy source directory.
  \pip-install-trxrwr8e\numpy\numpy\distutils\system_info.py:2077: UserWarning:
      Optimized (vendor) Blas libraries are not found.
      Falls back to netlib Blas library which has worse performance.
      A better performance should be easily gained by switching
      Blas library.
    if self._calc_info(blas):
 \pip-install-trxrwr8e\numpy\numpy\distutils\system_info.py:2077: 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.
    if self._calc_info(blas):
 pip-install-trxrwr8e\numpy\numpy\distutils\system_info.py:2077: 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.
    if self._calc_info(blas):
pip-install-trxrwr8e\numpy\numpy\distutils\system_info.py:1902: 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.
    return getattr(self, '_calc_info_{}'.format(name))()
 \numpy\numpy\distutils\system_info.py:1902: 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.
    return getattr(self, '_calc_info_{}'.format(name))()
  Warning: attempted relative import with no known parent package
 \lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

  ----------------------------------------
  Failed building wheel for numpy
  Running setup.py clean for numpy
  Complete output from command \Scripts\python.exe -u -c "import setuptools, tokenize;__file__='
  \\pip-install-  trxrwr8e\\numpy\\setup.py';
  f=getattr(tokenize, 'open', open)(__file__);
  code=f.read().replace('\r\n', '\n');
  f.close();exec(compile(code, __file__, 'exec')
)" clean --all:
  Running from numpy source directory.

  `setup.py clean` is not supported, use one of the following instead:

    - `git clean -xdf` (cleans all files)
    - `git clean -Xdf` (cleans all versioned files, doesn't touch
                        files that aren't checked into the git repo)

  Add `--force` to your command to use it anyway if you must (unsupported).


  ----------------------------------------
  Failed cleaning build dir for numpy
Failed to build numpy
Could not build wheels for numpy which use PEP 517 and cannot be installed directly

从报错内容看疑似编译环境问题
https://wiki.python.org/moin/WindowsCompilers

pip 安装 scipy报错

$ pip install scipy
Looking in indexes: 
Collecting scipy
  Using cached /scipy-1.8.1.tar.gz
  Installing build dependencies ... error
  Complete output from command \Scripts\python.exe \lib\site-packages\pip-19
.0.3-py3.8.egg\pip install --ignore-installed --no-user --prefix 
\pip-build-env-iogzj8v9\overlay --no-warn-script-location --no-binary :none: -
-only-binary :none:  --trusted-host  -- wheel<0.38.0 setuptools<60.0.0 Cython>=0.29.18,<3.0 pybind
11>=2.4.3,<2.9.0 pythran>=0.10.0,<0.11.0 "numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64' and platform_python_implementation != 'PyPy'" "numpy==1.20.0; p
ython_version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'" "numpy==1.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Da
rwin'" "numpy==1.17.5; python_version=='3.8' and platform_machine=='s390x' and platform_python_implementation != 'PyPy'" "numpy==1.17.3; python_version=='3.8' and (platform_m
achine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64' and platform_machine!='s390x' and platform_python_implementation != 'PyPy'" "numpy==1.19.3; pyth
on_version=='3.9' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_python_implementation != 'PyPy'" "numpy==1.21.4; python_version=='3.10' and platfo
rm_python_implementation != 'PyPy'" "numpy; python_version>='3.11'" "numpy; python_version>='3.8' and platform_python_implementation=='PyPy'":
  Ignoring numpy: markers 'python_version == "3.8" and platform_machine == "aarch64" and platform_python_implementation != "PyPy"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_machine == "arm64" and platform_system == "Darwin"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.9" and platform_machine == "arm64" and platform_system == "Darwin"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_machine == "s390x" and platform_python_implementation != "PyPy"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.9" and (platform_machine != "arm64" or platform_system != "Darwin") and platform_python_implementation != "PyPy"' don't match
your environment
  Ignoring numpy: markers 'python_version == "3.10" and platform_python_implementation != "PyPy"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.11"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.8" and platform_python_implementation == "PyPy"' don't match your environment
  Looking in indexes: 
  Collecting wheel<0.38.0
    Using cached /wheel-0.37.1-py2.py3-none-any.whl
  Collecting setuptools<60.0.0
    Using cached /setuptools-59.8.0-py3-none-any.whl
  Collecting Cython<3.0,>=0.29.18
    Using cached /Cython-0.29.30-py2.py3-none-any.whl
  Collecting pybind11<2.9.0,>=2.4.3
    Using cached /pybind11-2.8.1-py2.py3-none-any.whl
  Collecting pythran<0.11.0,>=0.10.0
    Using cached /pythran-0.10.0-py3-none-any.whl
  Collecting numpy==1.17.3
    Using cached /numpy-1.17.3.zip
  Collecting ply>=3.4 (from pythran<0.11.0,>=0.10.0)
    Using cached /ply-3.11-py2.py3-none-any.whl
  Collecting gast~=0.5.0 (from pythran<0.11.0,>=0.10.0)
    Using cached /gast-0.5.3-py3-none-any.whl
  Collecting beniget~=0.4.0 (from pythran<0.11.0,>=0.10.0)
    Using cached /beniget-0.4.1-py3-none-any.whl
  Building wheels for collected packages: numpy
    Building wheel for numpy (setup.py): started
    Building wheel for numpy (setup.py): finished with status 'error'
    Complete output from command \Scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\pip-install-szyxpo9w\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec
'))" bdist_wheel -d C:\pip-wheel-czsqh5ng --python-tag cp38:
    Running from numpy source directory.
    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 ['\\lib', 'C:\\']
      NOT AVAILABLE

    blis_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries blis not found in ['\\lib', 'C:\\']
      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 ['\\lib', 'C:\\']
    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
    Found executable C:\Program Files\Git\usr\bin\DF.exe
    Could not locate executable C:\Program
    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 ['\\lib', 'C:\\']
      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 ['\\lib', 'C:\\']
      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 ['\\lib', 'C:\\']
      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 ['\\lib', 'C:\\']
      NOT AVAILABLE

    accelerate_info:
      NOT AVAILABLE

   \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:690: UserWarning:
        Optimized (vendor) Blas libraries are not found.
        Falls back to netlib Blas library which has worse performance.
        A better performance should be easily gained by switching
        Blas library.
      self.calc_info()
    blas_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries blas not found in ['\\lib', 'C:\\']
      NOT AVAILABLE

   \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:690: 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

   \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:690: 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

    'svnversion' 不是内部或外部命令,也不是可运行的程序
    或批处理文件。
    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 ['\\lib', 'C:\\']
      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 ['\\lib', 'C:\\']
      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 ['\\lib', 'C:\\']
      NOT AVAILABLE

    flame_info:
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries flame not found in ['\\lib', 'C:\\']
      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 lapack_atlas not found in \lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries tatlas,tatlas not found in \lib
    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 C:\
    <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 lapack_atlas not found in \lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries satlas,satlas not found in \lib
    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 C:\
    <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 lapack_atlas not found in \lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in \lib
    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 C:\
    <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 lapack_atlas not found in \lib
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in \lib
    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 C:\
    <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 ['\\lib', 'C:\\']
      NOT AVAILABLE

   \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:1712: 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.
      if getattr(self, '_calc_info_{}'.format(lapack))():
    lapack_src_info:
      NOT AVAILABLE

   \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:1712: 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.
      if getattr(self, '_calc_info_{}'.format(lapack))():
      NOT AVAILABLE

    \lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    running bdist_wheel
    running build
    running config_cc
    unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    running config_fc
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build\src.win-amd64-3.8
    creating build\src.win-amd64-3.8\numpy
    creating build\src.win-amd64-3.8\numpy\distutils
    building library "npymath" sources
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

    ----------------------------------------
    Failed building wheel for numpy
    Running setup.py clean for numpy
    Complete output from command \Scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\pip-install-szyxpo9w\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec
'))" clean --all:
    Running from numpy source directory.

    `setup.py clean` is not supported, use one of the following instead:

      - `git clean -xdf` (cleans all files)
      - `git clean -Xdf` (cleans all versioned files, doesn't touch
                          files that aren't checked into the git repo)

    Add `--force` to your command to use it anyway if you must (unsupported).


    ----------------------------------------
    Failed cleaning build dir for numpy
  Failed to build numpy
  Installing collected packages: wheel, setuptools, Cython, pybind11, ply, gast, numpy, beniget, pythran
    Running setup.py install for numpy: started
      Running setup.py install for numpy: finished with status 'error'
      Complete output from command \Scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\pip-install-szyxpo9w\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'ex
ec'))" install --record \pip-record-_j9_fs2m\install-record.txt --single-version-externally-managed --prefix \pi
p-build-env-iogzj8v9\overlay --compile --install-headers include\site\python3.8\numpy:
      Running from numpy source directory.

      Note: if you need reliable uninstall behavior, then install
      with pip instead of using `setup.py install`:

        - `pip install .`       (from a git repo or downloaded source
                                 release)
        - `pip install numpy`   (last NumPy release on PyPi)


      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 ['\\lib', 'C:\\']
        NOT AVAILABLE

      blis_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries blis not found in ['\\lib', 'C:\\']
        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 ['\\lib', 'C:\\']
      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
      Found executable C:\Program Files\Git\usr\bin\DF.exe
      Could not locate executable C:\Program
      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 ['\\lib', 'C:\\']
        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 ['\\lib', 'C:\\']
        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 ['\\lib', 'C:\\']
        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 ['\\lib', 'C:\\']
        NOT AVAILABLE

      accelerate_info:
        NOT AVAILABLE

     \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:690: UserWarning:
          Optimized (vendor) Blas libraries are not found.
          Falls back to netlib Blas library which has worse performance.
          A better performance should be easily gained by switching
          Blas library.
        self.calc_info()
      blas_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries blas not found in ['\\lib', 'C:\\']
        NOT AVAILABLE

     \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:690: 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

      \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:690: 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

      'svnversion' 不是内部或外部命令,也不是可运行的程序
      或批处理文件。
      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 ['\\lib', 'C:\\']
        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 ['\\lib', 'C:\\']
        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 ['\\lib', 'C:\\']
        NOT AVAILABLE

      flame_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries flame not found in ['\\lib', 'C:\\']
        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 lapack_atlas not found in \lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries tatlas,tatlas not found in \lib
      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 C:\
      <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 lapack_atlas not found in \lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries satlas,satlas not found in \lib
      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 C:\
      <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 lapack_atlas not found in \lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries ptf77blas,ptcblas,atlas not found in \lib
      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 C:\
      <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 lapack_atlas not found in \lib
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries f77blas,cblas,atlas not found in \lib
      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 C:\
      <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 ['\\lib', 'C:\\']
        NOT AVAILABLE

     \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:1712: 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.
        if getattr(self, '_calc_info_{}'.format(lapack))():
      lapack_src_info:
        NOT AVAILABLE

     \pip-install-szyxpo9w\numpy\numpy\distutils\system_info.py:1712: 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.
        if getattr(self, '_calc_info_{}'.format(lapack))():
        NOT AVAILABLE

     \lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      running install
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src
      building py_modules sources
      building library "npymath" sources
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/


  ----------------------------------------
Command "\Scripts\python.exe \lib\site-packages\pip-19.0.3-py3.8.egg\pip ins
tall --ignore-installed --no-user --prefix \pip-build-env-iogzj8v9\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i
  --trusted-host  -- wheel<0.38.0 setuptools<60.0.0 Cython>=0.29.18,<3.0 pybind11>=2.4.3,<2.9.0 pythr
an>=0.10.0,<0.11.0 "numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64' and platform_python_implementation != 'PyPy'" "numpy==1.20.0; python_version=='3.8' a
nd platform_machine=='arm64' and platform_system=='Darwin'" "numpy==1.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darwin'" "numpy==1.17.5;
 python_version=='3.8' and platform_machine=='s390x' and platform_python_implementation != 'PyPy'" "numpy==1.17.3; python_version=='3.8' and (platform_machine!='arm64' orCommand "\Scripts\python.exe \lib\site-packages\pip-19.0.3-py3.8.egg\pip
 install --ignore-installed --no-user --prefix \pip-bu
ild-env-iogzj8v9\overlay --no-warn-script-location --no-binary :none: --only-binary :
none: 
inghua.edu.cn -- wheel<0.38.0 setuptools<60.0.0 Cython>=0.29.18,<3.0 pybind11>=2.4.3,
<2.9.0 pythran>=0.10.0,<0.11.0 "numpy==1.19.2; python_version=='3.8' and platform_mac
hine=='aarch64' and platform_python_implementation != 'PyPy'" "numpy==1.20.0; python_
version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'" "numpy==1
.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darw
in'" "numpy==1.17.5; python_version=='3.8' and platform_machine=='s390x' and platform_python_implementation != 'PyPy'" "numpy==1.17.3; python_version=='3.8' and (platform_mac
hine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64' and platform_machine!='s390x' and platform_python_implementation != 'PyPy'" "numpy==1.19.3; python
_version=='3.9' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_python_implementation != 'PyPy'" "numpy==1.21.4; python_version=='3.10' and platin'" "numpy==1.17.5; python_version=='3.8' and platform_machine=='s390x' and platform
_python_implementation != 'PyPy'" "numpy==1.17.3; python_version=='3.8' and (platform
_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64' and p
latform_machine!='s390x' and platform_python_implementation != 'PyPy'" "numpy==1.19.3
; python_version=='3.9' and (platform_machine!='arm64' or platform_system!='Darwin')
and platform_python_implementation != 'PyPy'" "numpy==1.21.4; python_version=='3.10' and platform_python_implementation != 'PyPy'" "numpy; python_version>='3.11'" "numpy; pyt
hon_version>='3.8' and platform_python_implementation=='PyPy'"" failed with error code 1 in None

pip 安装 pywin32 报错

$ pip install pywin32
Looking in indexes: 
Collecting pywin32
  Could not find a version that satisfies the requirement pywin32 (from versions: )
No matching distribution found for pywin32

解决办法

网络方法1


$ pip install numpy+mkl-cp38-none-win_amd64.whl
Requirement 'numpy+mkl-cp38-none-win_amd64.whl' looks like a filename, but the file does not exist
numpy+mkl-cp38-none-win_amd64.whl is not a valid wheel filename.

请测不适用,无效

网络方法2

根据 https://visualstudio.microsoft.com/visual-cpp-build-tools/
安装微软 Visual Studio 重新搭建C++编译环境

$ pip install numpy-1.18.5+mkl-cp38-none-win_amd64.whl
Requirement 'numpy-1.18.5+mkl-cp38-none-win_amd64.whl' looks like a filename, but the file does not exist
Looking in indexes: 
Processing \numpy-1.18.5+mkl-cp38-none-win_amd64.whl
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '\\numpy-1.18.5+mkl-cp38-non
e-win_amd64.whl'

过程繁琐未测试

亲测解决方法

将pip版本退回较低版本,不使用最新的版本

$ python -m pip install pip==20.2.4
Looking in indexes: 
Collecting pip==20.2.4
  Downloading /pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
     ---------------------------------------- 1.5/1.5 MB 2.2 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.1.2
    Uninstalling pip-22.1.2:
      Successfully uninstalled pip-22.1.2
Successfully installed pip-20.2.4

$

再次安装,成功

$ pip install numpy
Looking in indexes: 
Collecting numpy
  Downloading /numpy-1.22.4-cp38-cp38-win_amd64.whl (14.8 MB)
     |████████████████████████████████| 14.8 MB 1.3 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.22.4
WARNING: You are using pip version 20.2.4; however, version 22.1.2 is available.
You should consider upgrading via the '\Scripts\python.exe -m pip install --upgrade pip' command.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

《Python笔记》安装(pip)第三方包报错 的相关文章

  • 使用 InlineKeyboardButton python telegram bot 发送命令

    在Python电报机器人中 是否有可能InlineKeyboardButton发送类似命令 cancel当它被按下时 例如 当用户按下取消按钮时 他们将自动发送 cancel 命令 然后由机器人处理 从这里的例子来看 https githu
  • 如何更改默认的Python版本?

    我已经在我的 Mac 上安装了 Python 3 2 我跑完之后 Applications Python 3 2 Update Shell Profile command 当我输入时 这很令人困惑Python V在终端它说Python 2
  • 如何在 QTableView 标题中单击鼠标右键单击上下文菜单?

    下面的示例代码 很大程度上受到here http www saltycrane com blog 2007 12 pyqt 43 qtableview qabstracttablemodel 有一个右键单击上下文菜单 当用户单击表中的单元格
  • Python Numpy Reshape错误[关闭]

    Closed 这个问题是无法重现或由拼写错误引起 help closed questions 目前不接受答案 我在尝试重塑 3D numpy 数组时遇到一个奇怪的错误 数组 x 的形状为 6 10 300 我想将其重塑为 6 3000 我正
  • 高效地将大型 Pandas 数据帧写入磁盘

    我正在尝试找到使用 Python Pandas 高效地将大型数据帧 250MB 写入磁盘或从磁盘写入的最佳方法 我已经尝试了所有方法Python 数据分析 但表现却非常令人失望 这是一个更大项目的一部分 该项目探索将我们当前的分析 数据管理
  • Python设置1和True的解释

    在 IPython 3 交互式 shell 中 In 53 set2 1 2 True hello In 54 len set2 Out 54 3 In 55 set2 Out 55 hello True 2 是因为 1 和 True 得到
  • 如何检索分配给 Django 中的组的所有权限

    我正在执行一项任务来检索分配给 Django 中的组的一组权限 我可以使用以下代码获取创建的组 但无法使用它来获取分配给它们的权限 from django contrib auth models import Group Permissio
  • Python函数组成

    我尝试使用良好的语法来实现函数组合 这就是我所得到的 from functools import partial class compfunc partial def lshift self y f lambda args kwargs s
  • 如果另一列中的值为空,则删除重复项 - Pandas

    我拥有的 df Name Vehicle Dave Car Mark Bike Steve Car Dave Steve 我想从 名称 列中删除重复项 但前提是 车辆 列中的相应值为空 我知道我可以使用 df dropduplicates
  • Karasuba算法递归过多

    我正在尝试用 c 实现 Karasuba 乘法算法 但现在我只是想让它在 python 中工作 这是我的代码 def mult x y b m if max x y lt b return x y bm pow b m x0 x bm x1
  • 如何仅注释堆积条形图的一个类别

    我有一个数据框示例 如下所示 data Date 2021 07 18 2021 07 19 2021 07 20 2021 07 21 2021 07 22 2021 07 23 Invalid NaN 1 1 NaN NaN NaN N
  • 一个类似 dict 的 Python 类

    我想编写一个自定义类 其行为类似于dict 所以 我继承自dict 不过 我的问题是 我是否需要创建一个私有的dict我的成员 init 方法 我不明白这个有什么意义 因为我已经有了dict如果我只是继承自的行为dict 谁能指出为什么大多
  • Python:“直接”调用方法是否实例化对象?

    我是 Python 新手 在对我的对象进行单元测试时 我注意到一些 奇怪 的东西 class Ape object def init self print ooook def say self s print s def main Ape
  • 在 pygame 中,我如何创建一个数据结构来跟踪调整大小事件和对象的坐标?

    我希望在调整屏幕大小后使鼠标事件与对象保持同步 有人告诉我需要创建一个数据结构来跟踪 调整事件大小 新坐标以匹配调整大小 如何使用简单的代数方程来完成此操作并将其集成到调整大小事件中以进行准确更新 反过来做 创建一个虚拟游戏地图 在绘制场景
  • django 中的身份验证方法返回 None

    你好 我在 django 中做了一个简单的注册和登录页面 当想要登录时 登录视图中的身份验证方法不返回任何内容 我的身份验证应用程序 模型 py from django db import models from django contri
  • 更改用作函数全局作用域的字典

    我想做一个 purePython 的装饰器 其中一部分是能够有选择地禁止访问函数的全局范围 有没有一种方法可以以编程方式更改哪个字典事物充当函数的全局 外部作用域 因此 例如在下面我希望能够拦截对f in h并抛出错误 但我想允许访问g因为
  • 异步异常处理程序:在事件循环线程停止之前不会被调用

    我正在我的异步事件循环上设置异常处理程序 但是 在事件循环线程停止之前 它似乎不会被调用 例如 考虑以下代码 def exception handler loop context print Exception handler called
  • Python matplotlib:将轴标签/图例从粗体更改为常规粗细

    我正在尝试制作一些出版质量的图 但遇到了一个小问题 默认情况下 matplotlib 轴标签和图例条目的权重似乎比轴刻度线重 是否有办法强制轴标签 图例条目与刻度线的重量相同 import matplotlib pyplot as plt
  • 在不同的 GPU 上同时训练多个 keras/tensorflow 模型

    我想在 Jupyter Notebook 中同时在多个 GPU 上训练多个模型 我正在使用 4GPU 的节点上工作 我想将一个 GPU 分配给一个模型并同时训练 4 个不同的模型 现在 我通过 例如 为一台笔记本选择 GPU import
  • OSError: [WinError 193] %1 不是有效的 Win32 应用程序,同时使用 CTypes 在 python 中读取自定义 DLL

    我正在尝试编写用 python 封装 C 库的代码 我计划使用 CTypes 来完成此操作 并使用 Visual Studio 来编译我的 DLL 我从一个简单的函数开始 在 Visual Studio 内的标头中添加了以下内容 然后将其构

随机推荐

  • [STM32]KEIL调试程序进入HardFault_Handler异常处理总结

    在做CORTEX M3单片机开发的时候 如STM32 可能会遇到设备跑着跑着程序死机的情况 往往调试起来很多时候发现是程序进入HardFault Handler系统异常 根据相关资料和M3权威指南是可以通过调试查找出程序的问题点和解决问题的
  • eclipse gradle打包_Spring Boot(十二):Spring Boot 如何测试打包部署

    部分面试资料链接 https pan baidu com s 1qDb2YoCopCHoQXH15jiLhA 密码 jsam 想获得全部面试必看资料 关注公众号 大家可以在公众号后台回复 知乎 即可 有很多网友会时不时的问我 Spring
  • 一个人的成功不是没有理由的!(人物之楼天城)

    昨天 杭州第十四中学请来毕业生楼天城 给全体学生做励志讲座 讲高中三年的学习生活和理科思维的培养 讲座前 老师介绍 楼天城同学2004年毕业于十四中 保送清华大学 博士毕业 是公认的计算机天才 公认的中国大学生编程竞赛第一人 常以一人单挑一
  • 利用python摘取文本中所需信息,并保存为txt格式

    项目所需 IC设计中难免会处理大量文本信息 我就在项目中遇到了 对于一个几万行的解码模块 提取出其中的指令 如果不用脚本将会很麻烦 下面我将一个小小的例子分享给大家 刚学python 如果有更方便的实现方法清多多指教 目的 1 在几万行解码
  • Git常用命令总结

    Git常用命令总结 git init 在本地新建一个repo 进入一个项目目录 执行git init 会初始化一个repo 并在当前文件夹下创建一个 git文件夹 git clone 获取一个url对应的远程Git repo 创建一个loc
  • openssl的证书链验证

    原文地址 http blog csdn net dog250 article details 5442914 使用openssl验证证书链可以用以下命令 debian home zhaoya openssl openssl verify C
  • C语言分支循环语句

    需提前看 初识C语言 5 C语言一些基本常识 目录 分支语句 if语句 单if语句使用 if else语句 if else if else语句 switch语句 switch基本结构 break作用 default作用 循环语句 while
  • 【Vscode

    Rmd文件转html R语言环境 Vscode扩展安装及配置 配置radian R依赖包 pandoc安装 配置pandoc环境变量 验证是否有效 转rmd为html 注意本文代码块均为R语言代码 在R语言环境下执行即可 R语言环境 官网中
  • shell I/O重定向

    shell重定向 lt 改变标准输入 program lt file 可将program 的标准输入改为file tr d r lt dos file txt 以 gt 改变标准输出 program gt file 可将program的标准
  • Qt基础之三十:百万级任务并发处理

    在实际的开发过程中 经常会遇到要处理大量任务场景 比如说压缩文件夹中的所有文件 对文件夹中的所有文件加密 上传文件夹中的所有文件到ftp等等 这里说百万级并不夸张 理论上文件夹中有任意多个文件都是可以的 本文以压缩文件夹中的100万张jpg
  • 三国志13pk版登录武将输入中文名方法与更改图像详解

    今天来个正经的文 三国志13里登录武将 设定姓名时 如果用的是自带输入法 就会出现一堆乱码 这时候 有两种解决方法 下载一个具有大五码的输入法 然后输入时候既要切换输入法 切换繁体 切换窗口模式 很麻烦 尤其在输入列传的时候 打很多字会很不
  • 【架构优化过程思考】技术方案评估的三个维度

    方案的选择决定了当下实现方案的资源投入及产出对产 也决定后续的成本 评估一个方案 首先要评估这个方案的有效性 也就是说要解决这个问题 实现目标 当前的这个方案是否足够的有效 还是在部分的场景下有效 如果是全部的有效那么该方案就不会出现上线之
  • 二叉树--合并二叉树

    问题 已知两颗二叉树 将它们合并成一颗二叉树 合并规则是 都存在的结点 就将结点值加起来 否则空的位置就由另一个树的结点来代替 思路 通过二叉树的前序遍历方法进行遍历 同时 t1二叉树作为蓝本进行计算 注意设置两个指针记录t1和t2遍历到的
  • JavaScript重写alert,confirm,prompt方法(JavaScript实现线程非阻塞式暂停和启动)

    得有段时间没好好写篇博客了 这次我们从一个题目开始吧 首先我给大家出一道题目 大家可以先思考一下 再往下看 题目是 请用JavaScript重写confirm方法 实现和confirm同样的功能 乍一看可能感觉很简单 定义一个confirm
  • php cms 自动分词,灵活运用PHPAnalysis分词组件,实现Phpcms v9关键词自动分词

    在2019年12月下旬 Phpcms官网phpcms cn关闭后 原有的分词api接口 http tool phpcms cn api get keywords php 已经失效 在录入标题后再也不能自动提取关键词到关键词的输入栏了 针对这
  • ReentrantLock的实现

    ReentrantLock可重入锁 我们可以利用这个实现对某一个操作约束为同有个时刻只能有一个线程能够操作 我们呢先看一下下面这个demo public class ReentrantLockTest public static void
  • 初级黑客入门指南——强烈推荐

    黑客指的是在计算机或计算机网络中发现弱点的人 尽管这个术语也可以指对计算机和计算机网络有深入了解的人 黑客的动机可能是多方面的 比如利润 抗议或挑战 围绕黑客发展的亚文化通常被称为 地下计算机 但现在它是一个开放的社区 虽然黑客这个词的其他
  • Python之由公司名推算出公司官网(余弦相似度)

    读大学时期写的博文 1 问题 对展会数据分类后 我的新任务是如何通过 公司名 公司地址 国家等海关数据推断出该公司的官网网站 若官网不存在则不考虑 以下数据仅供参考 公司名 国家 地址 JPW INDUSTRIES INC 427 NEW
  • 经典神经网络 -- DenseNet : 设计原理与pytorch实现

    原理 概念与网络结构 DenseNet模型 它的基本思路与ResNet一致 但是它建立的是前面所有层与后面层的密集连接 dense connection DenseNet的一大特色是通过 特征在channel上的连接 来实现特征重用 fea
  • 《Python笔记》安装(pip)第三方包报错

    目录 Python版本 报错信息 pip 安装numpy报错 pip 安装 scipy报错 pip 安装 pywin32 报错 解决办法 网络方法1 网络方法2 亲测解决方法 Python版本 python Python 3 8 10 ta