簡體   English   中英

ModuleNotFoundError:安裝庫時沒有名為“_ctypes”的模塊

[英]ModuleNotFoundError: No module named '_ctypes' while installing libraries

我在其他地方沒有找到任何有用的答案,所以我想在這里尋求幫助。

我正在嘗試設置 VPS,我需要一些庫(如 datetime 和 random),但是,當我輸入pip3.10 install datetime時,它只會給我一堆錯誤:

WARNING: Discarding https://files.pythonhosted.org/packages/e5/4f/86e90a34419df9c32a6e88b06f18233cffe93a236f7d2690f707c816fbe6/zope.interface-5.1.2.tar.gz#sha256=c9c8e53a5472b77f6a391b515c771105011f4b40740ce53af8428d1c8ca20004 (from https://pypi.org/simple/zope-interface/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached zope.interface-5.1.1.tar.gz (228 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3.10 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f5fedo38/zope-interface_a42655eef45a4ad1a0d08ba394ed5e01/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f5fedo38/zope-interface_a42655eef45a4ad1a0d08ba394ed5e01/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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-pc68spm2
       cwd: /tmp/pip-install-f5fedo38/zope-interface_a42655eef45a4ad1a0d08ba394ed5e01/
  Complete output (11 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 18, in <module>
      from setuptools.dist import Distribution
    File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 38, in <module>
      from setuptools import windows_support
    File "/usr/local/lib/python3.10/site-packages/setuptools/windows_support.py", line 2, in <module>
      import ctypes
    File "/usr/local/lib/python3.10/ctypes/__init__.py", line 8, in <module>
      from _ctypes import Union, Structure, Array
  ModuleNotFoundError: No module named '_ctypes'
  ----------------------------------------

我應該怎么辦?

看起來,您正在嘗試安裝所有built-in模塊。

您根本不必重新安裝它們

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM