无法使用pip3安装Pandas库



我尝试安装Pandas库uisgpip3,并得到以下错误:

ERROR: Command errored out with exit status 1:
command: /Users/chaklader/PycharmProjects/OptimizingPublicTransport/producers/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/setup.py'"'"'; __file__='"'"'/private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-wheel-1lu27a0t
cwd: /private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/
Complete output (938 lines):

/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^
/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
14 warnings and 4 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pandas
Running setup.py clean for pandas
Failed to build pandas
Installing collected packages: pandas
Attempting uninstall: pandas

这里的问题是什么?如何解决?

我猜您使用的python版本太高了,请参阅类似的问题12。

你可以试试python 3.6。在安装软件包之前,您应该始终升级pip

正如你在pip安装日志中看到的,它试图从一些C/C++源代码进行编译,需要一些有时不可用的构建工具。

所以我建议你使用来自维基的anaconda:

Anaconda是Python和R编程语言的一个分布对于科学计算(数据科学、机器学习应用,大规模数据处理、预测分析等(,旨在简化包管理和部署。

最新更新