python - Openpyxl Pip 安装错误:命令出错
问题描述
尝试安装 openpyxl 时,我继续收到以下错误:
pip install openpyxl
Collecting openpyxl
Using cached openpyxl-3.0.3.tar.gz (172 kB)
ERROR: Command errored out with exit status 1:
command: /home/bigdata/scripts/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eztesmv9/openpyxl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eztesmv9/openpyxl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-eztesmv9/openpyxl/pip-egg-info
cwd: /tmp/pip-install-eztesmv9/openpyxl/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/bigdata/scripts/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/bigdata/scripts/lib/python3.8/site-packages/setuptools/dist.py", line 36, in <module>
from setuptools import windows_support
File "/home/bigdata/scripts/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/home/bigdata/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.
根据其他帖子,我已经尝试过以下命令:
python3 -m ensurepip --upgrade
pip install --upgrade setuptools
pip install -U pip
随着他们每个人的回归:
Requirement already up-to-date: setuptools in /home/bigdata/scripts/lib/python3.8/site-packages (45.1.0)
我错过了什么吗?我们刚刚将我们的帐户迁移到 A2 Hosting VPS 服务器,我对大部分设置都不熟悉。任何帮助深表感谢。
解决方案
我可以通过重新安装 python 来解决这个问题,遵循来自 phd 的线索,我可能有一个损坏的安装。
推荐阅读
- tensorflow - 我应该在张量板上观察哪些损失标量?
- mysql - 无论列顺序如何,我如何删除重复项的 SQL 查询问题
- arcgis - ESRI ArcGIS:位置点 [使用纬度,经度] 未在 arcGIS 地图上的正确位置呈现
- scikit-learn - sklearn PCA 组件数_
- php - 在 php 获取页面脚本中防止目录遍历
- google-bigquery - 如何修改 BigQuery 表中的列数据
- python - 数据透视表中的 Python 多重计算
- r - 将哈希表/字典/数组格式数据转换为基于常规列的 data.frame
- node.js - 如何使用云功能对 Firestore 数据进行分页?
- javascript - 我的 switch 语句有什么问题?