在我的 Mac 上使用 python 3.9 安装 Pandas 和 yfinance 时出现问题

2024-04-06

我正在尝试使用 python -m pip install yfinance 命令来安装 yfinance。该命令引用了 python 3.9.0

当我尝试这样做时,我收到以下信息:

Collecting yfinance
  Using cached yfinance-0.1.55.tar.gz (23 kB)
Collecting pandas>=0.24
  Using cached pandas-1.1.3.tar.gz (5.2 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-build-env-qtruga5a/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.21,<3' 'numpy==1.15.4; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.15.4; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"''
       cwd: None
  Complete output (274 lines):
  Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
  Collecting setuptools
    Using cached setuptools-50.3.1-py3-none-any.whl (785 kB)
  Collecting wheel
    Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
  Collecting Cython<3,>=0.29.21
    Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB)
  Collecting numpy==1.17.3
    Using cached numpy-1.17.3.zip (6.4 MB)
  Using legacy 'setup.py install' for numpy, since package 'wheel' is not installed.
  Installing collected packages: setuptools, wheel, Cython, numpy
      Running setup.py install for numpy: started
      Running setup.py install for numpy: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-record-rc02kt8n/install-record.txt --single-version-externally-managed --prefix /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-build-env-qtruga5a/overlay --compile --install-headers /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-build-env-qtruga5a/overlay/include/python3.9/numpy
           cwd: /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/
      Complete output (251 lines):
      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:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      blis_info:
      customize UnixCCompiler
        libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      openblas_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries tatlas not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      atlas_3_10_blas_info:
      customize UnixCCompiler
        libraries satlas not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      atlas_blas_info:
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      accelerate_info:
      customize UnixCCompiler
        libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
      Library accelerate was not found. Ignoring
      customize UnixCCompiler
        libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
      Library veclib was not found. Ignoring
        FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
  
        FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
  
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      non-existing path in 'numpy/distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      openblas_lapack_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      openblas_clapack_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      flame_info:
      customize UnixCCompiler
        libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
  
      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries lapack_atlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE
  
      atlas_3_10_info:
      customize UnixCCompiler
        libraries lapack_atlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries satlas,satlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries satlas,satlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries satlas,satlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_3_10_info'>
        NOT AVAILABLE
  
      atlas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries lapack_atlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_threads_info'>
        NOT AVAILABLE
  
      atlas_info:
      customize UnixCCompiler
        libraries lapack_atlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in /Library/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE
  
        FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
  
      /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/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
      creating build
      creating build/src.macosx-10.9-x86_64-3.9
      creating build/src.macosx-10.9-x86_64-3.9/numpy
      creating build/src.macosx-10.9-x86_64-3.9/numpy/distutils
      building library "npymath" sources
      get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
      customize Gnu95FCompiler
      Could not locate executable gfortran
      Could not locate executable f95
      customize NAGFCompiler
      customize AbsoftFCompiler
      Could not locate executable f90
      Could not locate executable f77
      customize IBMFCompiler
      Could not locate executable xlf90
      Could not locate executable xlf
      customize IntelFCompiler
      Could not locate executable ifort
      Could not locate executable ifc
      customize GnuFCompiler
      Could not locate executable g77
      customize G95FCompiler
      Could not locate executable g95
      customize PGroupFCompiler
      Could not locate executable pgfortran
      don't know how to compile Fortran code on platform 'posix'
      C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g
  
      compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c'
      gcc: _configtest.c
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      failure.
      removing: _configtest.c _configtest.o
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/setup.py", line 443, in <module>
          setup_package()
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/setup.py", line 435, in setup_package
          setup(**metadata)
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/core.py", line 171, in setup
          return old_setup(**new_attr)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
          return distutils.core.setup(**attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/install.py", line 62, in run
          r = self.setuptools_run()
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
          return distutils_install.run(self)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/install.py", line 546, in run
          self.run_command('build')
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/build.py", line 47, in run
          old_build.run(self)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/build_src.py", line 142, in run
          self.build_sources()
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/build_src.py", line 153, in build_sources
          self.build_library_sources(*libname_info)
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/build_src.py", line 286, in build_library_sources
          sources = self.generate_sources(sources, (lib_name, build_info))
        File "/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/numpy/distutils/command/build_src.py", line 369, in generate_sources
          source = func(extension, build_dir)
        File "numpy/core/setup.py", line 669, in get_mathlib_info
          raise RuntimeError("Broken toolchain: cannot link a simple C program")
      RuntimeError: Broken toolchain: cannot link a simple C program
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-install-zco_j2o6/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-record-rc02kt8n/install-record.txt --single-version-externally-managed --prefix /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-build-env-qtruga5a/overlay --compile --install-headers /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-build-env-qtruga5a/overlay/include/python3.9/numpy Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/wf/7bsfd_1x77b12zq1y6w6kd000000gn/T/pip-build-env-qtruga5a/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.21,<3' 'numpy==1.15.4; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.15.4; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' Check the logs for full command output.

我该如何解决?和我用的python版本有关系吗?以前我对 numpy 和 pandas 没有任何问题。


“截至 10 月 6 日,NumPy(Pandas 依赖项)的 PyPI 文件列表和 Pandas 的文件列表均未显示 Python 3.9 轮子。当然,您可以从源代码编译这些包,假设它们可以在 Python 3.9 中开箱即用——但这需要更多的努力(设置编译器)和时间。”

https://pythonspeed.com/articles/switch-python-3.9/ https://pythonspeed.com/articles/switch-python-3.9/

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

在我的 Mac 上使用 python 3.9 安装 Pandas 和 yfinance 时出现问题 的相关文章

  • sqlalchemy,混合属性 case 语句

    这是我试图通过 sqlalchemy 生成的查询 SELECT order id AS id order created at AS created at order updated at AS updated at CASE WHEN b
  • ./manage.py 使用 https 运行服务器

    manage py 运行服务器 0 0 0 0 8000 我使用上面的行作为我从 github 借用的代码的一部分 https github com ribeiroit boh puppet https github com ribeiro
  • 图像从部署到heroku的django web应用程序中消失

    我正在开发一个 django 项目 使用 django Rest 框架编写 REST API 以在 Android 应用程序中使用它们 我的主要想法是在 Django 中开发后端 在 Android 中开发前端 项目部署在 Heroku 上
  • 如何创建 sqlalchemy 到 json

    我有一个 sqlalchemy 结果 labels session query LabelsData LabelsData id LabelsData name LabelsData color filter LabelsData dele
  • 调试:获取调用函数的文件名和行号?

    我目前正在用 Python 构建一个相当复杂的系统 当我调试时 我经常在几个脚本中放入简单的打印语句 为了保持概览 我经常还想打印出打印语句所在的文件名和行号 我当然可以手动执行此操作 或者使用类似这样的操作 from inspect im
  • 带有透明图像的可拖动 Tkinter 标签仍然覆盖父画布中的图像

    我正在努力在背景图像顶部添加可拖动标签 其中标签是具有透明背景的图像 用于标签本身的图像是透明的 但标签本身相对于其父画布不透明 由于标签是可拖动的 我无法轻松使用父图像作为标签 并将透明图像粘贴在顶部 龙是一个可拖动的标签 具有透明背景
  • Python 中的字符串、整数和运算符

    如何在运算中使用算术运算符 由用户作为字符串输入 我可以打印操作本身 但我想打印解决方案 这是我的笨拙尝试 Initialise variables x 2 y 3 Prompt the user for an arithmetic ope
  • 在嵌套有序字典 python 中查找给定键的值

    我试图从嵌套的 OrderedDict 中查找给定键的值 关键点 我不知道这个字典会嵌套多深 我正在寻找的键的名称是不变的 它将位于字典中的某个位置 我想返回本例中名为 powerpoint color 的键的值 mydict Ordere
  • 如何在 Django 中设置和获取会话?

    当用户登录时 我需要在会话上设置一个变量 我怎样才能做到这一点 if request user is authenticated profile request user get profile request session idempr
  • Python:将字典转换为字节

    我正在尝试将字典转换为字节 但在将其转换为正确的格式时遇到问题 首先 我尝试使用自定义架构映射字典 模式定义如下 class User def init self name None code None self name name sel
  • Tensorflow:使用 Adam 优化器

    我正在张量流中试验一些简单的模型 包括一个看起来与第一个非常相似的模型面向 ML 初学者的 MNIST 示例 http www tensorflow org tutorials mnist beginners index md 但维数稍大一
  • Python 模块导入对一个文件有效,对另一个文件则失败

    我面临着一个非常奇怪的问题 我有三个文件 第一个包含基类 其他两个文件中的类继承自该基类 奇怪的是 昨天一切都工作正常 但今天其中一个文件不再工作了 在此期间我还没有接触过进口 orangecontrib init py prototype
  • 绘制顶部有函数线的直方图

    我正在尝试使用 SciPy 进行统计 使用 matplotlib 进行绘图 在 Python 中进行一些分布绘图和拟合 我在创建直方图等方面运气很好 seed 2 alpha 5 loc 100 beta 22 data ss gamma
  • 在 python 中检查堆栈中的局部变量

    我编写了一个小函数 它在堆栈中查找一级并查看其中是否有变量 但是我如何将这个函数变成一个可以在堆栈中一直查找直到找到一个局部变量并购买某个特定名称的函数 import inspect def variable lookup variable
  • python 拆分而不创建空白

    我明白为什么使用 split 创建空白很重要 这要归功于这个问题 https stackoverflow com questions 2197451 why are empty strings returned in split resul
  • 分段错误(核心转储),执行线程

    我试图在 python 中运行一个程序 该程序打开一个程序并从其标准输出中读取 当我运行程序代码时 出现分段错误错误 但是当我将代码放入函数 Myfunc 中的线程外时 它可以正常工作 我不明白发生了什么 这是我的代码 class Work
  • 使用 CustomCallback() 类在训练时实现冻结层

    我正在尝试在 TensorFlow 中训练自定义 CNN 模型 我想以某种方式在训练仍在运行时冻结特定时期模型的某些层 我已经实现了冻结层 但我必须在某些时期训练模型 然后在我想要冻结的特定层中将可训练属性更改为 False 然后编译模型
  • 添加类方法后如何更新类的实例?

    我发现自己陷入了困境 我开发了一个类 然后创建了该类的一个实例 这些类通常会执行数据和统计操作 这些操作需要很长时间 有时需要 20 分钟 我将继续开发我的类 并向其中添加其他方法 现在 如何使用新方法更新以前的类实例而不重新初始化该类的旧
  • python 中的 stdin 和 sys.argv 有什么区别? [复制]

    这个问题在这里已经有答案了 我在一次编码挑战中被扣分 该挑战指定我需要从 STDIN 读取 这是我的输入法 def init self input self dictionary with open input r as f reader
  • 如何在 Pandas 的时间序列图上绘制垂直线?

    如何绘制垂直线 vlines 在熊猫系列情节中 我正在使用 Pandas 绘制滚动平均值等 并且想用垂直线标记重要位置 是否可以使用vlines或类似的东西来完成这个 在这种情况下 x 轴是datetime plt axvline x po

随机推荐