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



我正在尝试安装yfnance"sudo-H pip install yfnance";在这篇文章的底部不断出现以下错误。我已经卸载/安装了pip。我已经通过pip卸载/安装了setuptools,并尝试了以下命令:

python3 -m ensurepip --upgrade
Requirement already up-to-date: setuptools in /usr/local/lib/python3.8/site-packages (49.2.0)
Requirement already up-to-date: pip in /usr/local/lib/python3.8/site-packages (20.1.1)
pip install --upgrade pip
Requirement already up-to-date: pip in /usr/local/lib/python3.8/site-packages (20.1.1)
pip install --upgrade setuptools
Requirement already up-to-date: setuptools in /usr/local/lib/python3.8/site-packages (49.2.0)

Python版本

python --version
Python 3.8.3

Pip版本

pip --version
pip 20.1.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

系统更新检查

sudo apt-get upgrade
sudo apt-get update

当我运行";sudo-H pip install yfnance">

*****@*******:~/Desktop/Project$ sudo -H pip install yfinance
Collecting yfinance
Using cached yfinance-0.1.54.tar.gz (19 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xpuca0pe/yfinance/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xpuca0pe/yfinance/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-1j4zanh6
cwd: /tmp/pip-install-xpuca0pe/yfinance/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 23, in <module>
from setuptools.dist import Distribution
File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

如何修复此错误?

运行此命令后,它修复了错误。

参考:https://packaging.python.org/tutorials/installing-packages/

sudo -H python -m pip install --upgrade pip setuptools wheel

相关内容

  • 没有找到相关文章

最新更新