我无法在Windows 10上从cmd安装熊猫,我正在使用python 3.9

时间:2019-12-22 23:36:52

标签: pandas pip windows-10

错误:命令错误,退出状态为1:      命令:'c:\ users \ luis \ appdata \ local \ programs \ python \ python39 \ python.exe'-c'import sys,setuptools,tokenize; sys.argv [0] ='“'”'C:\ Users \ LUIS \ AppData \ Local \ Temp \ pip-install-4kret5jq \ pandas \ setup.py'“'”'; 文件 ='“'”'C:\ Users \ LUIS \ AppData \ Local \ Temp \ pip-install-4kret5jq \ pandas \ setup.py'“'”'; f = getattr(tokenize, '“”“'open'”'“,打开)(文件); code = f.read()。replace('”'“'\ r \ n'”'“', '“'”'\\ n'“'”'); f.close(); exec(compile(code, file ,'“'”'exec'“'”')))'egg_info --egg-base'C:\ Users \ LUIS \ AppData \ Local \ Temp \ pip-install-4kret5jq \ pandas \ pip-egg-info'          cwd:C:\ Users \ LUIS \ AppData \ Local \ Temp \ pip-install-4kret5jq \ pandas \     完整输出(101行):     处理numpy / random_bounded_integers.pxd.in     处理numpy / random \ mtrand.pyx     追溯(最近一次通话):       第61行的文件“ C:\ Users \ LUIS \ AppData \ Local \ Temp \ easy_install-w8b3tt8f \ numpy-1.18.0 \ tools \ cythonize.py”在process_pyx中         从Cython.Compiler.Version导入为cython_version     ModuleNotFoundError:没有名为“ Cython”的模块

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\tools\cythonize.py", line 238, in <module>
    main()
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\tools\cythonize.py", line 234, in main
    find_process_files(root_dir)
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\tools\cythonize.py", line 225, in find_process_files
    process(root_dir, fromfile, tofile, function, hash_db)
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\tools\cythonize.py", line 191, in process
    processor_function(fromfile, tofile)
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\tools\cythonize.py", line 66, in process_pyx
    raise OSError('Cython needs to be installed in Python as a module')
OSError: Cython needs to be installed in Python as a module
Running from numpy source directory.
C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py:425: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
  run_build = parse_setuppy_commands()
Traceback (most recent call last):
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py", line 450, in <module>

  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py", line 433, in setup_package
    def finalize_options(self):
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py", line 240, in generate_cython
    """Custom distutils command to clean the .so and .pyc files."""
RuntimeError: Running cythonize failed!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\LUIS\AppData\Local\Temp\pip-install-4kret5jq\pandas\setup.py", line 809, in <module>
    setup(
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 144, in setup
    _install_setup_requires(attrs)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
    resolved_dists = pkg_resources.working_set.resolve(
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
    dist = best[req.key] = env.best_match(
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
    return installer(requirement)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
    return cmd.easy_install(req)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
    run_setup(setup_script, args)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
    raise
  File "c:\users\luis\appdata\local\programs\python\python39\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "c:\users\luis\appdata\local\programs\python\python39\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "c:\users\luis\appdata\local\programs\python\python39\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py", line 450, in <module>

  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py", line 433, in setup_package
    def finalize_options(self):
  File "C:\Users\LUIS\AppData\Local\Temp\easy_install-w8b3tt8f\numpy-1.18.0\setup.py", line 240, in generate_cython
    """Custom distutils command to clean the .so and .pyc files."""
RuntimeError: Running cythonize failed!
Cythonizing sources
----------------------------------------

错误:命令错误,退出状态为1:python setup.py egg_info检查日志以获取完整的命令输出。

1 个答案:

答案 0 :(得分:0)

熊猫目前released wheels适用于Python 3.5-3.8。 Python 3.9尚未发布,也没有为熊猫或其依赖项(特别是numpy)提供轮子。

我的建议是安装受支持的Python版本。 Python 3.7是目前最好的,Python 3.8有点新。但是Python 3.9尚未准备好。

如果您坚持使用Python 3.9,则必须从源代码编译 pandas和所有依赖项。安装compiler,安装Cython,等等……