首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Pip3无法为python3.8.6安装"empy“(没有为empy找到匹配的发行版)

Pip3无法为python3.8.6安装"empy“(没有为empy找到匹配的发行版)
EN

Stack Overflow用户
提问于 2022-01-26 22:20:18
回答 1查看 699关注 0票数 0

我试图在我的ubuntu18.04PC上使用python3.8.6创建的虚拟环境中安装带有pip3 install empy命令的pip3 install empy,但得到了以下主要错误:

代码语言:javascript
运行
复制
ERROR: Could not find a version that satisfies the requirement empy (from versions: 3.3.2, 3.3.4)
ERROR: No matching distribution found for empy 

我还使用sudo apt-get install libffi-dev安装了“libffi”,以防止错误ModuleNotFoundError: No module named '_ctypes',但错误仍然存在,并且保持不变。

完全错误,如终端中的:

代码语言:javascript
运行
复制
(py3venv) expert-bot@expert-nx:~/python3_ws$ pip3 install empy
Collecting empy
  Using cached empy-3.3.4.tar.gz (62 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/expert-bot/python3_ws/py3venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-04mt1wt_/empy_f5b8490ded264bce82e92de860ffaccf/setup.py'"'"'; file__='"'"'/tmp/pip-install-04mt1wt_/empy_f5b8490ded264bce82e92de860ffaccf/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-vx6cf784
       cwd: /tmp/pip-install-04mt1wt_/empy_f5b8490ded264bce82e92de860ffaccf/
  Complete output (13 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/home/expert-bot/python3_ws/py3venv/lib/python3.8/site-packages/setuptools/__init__.py", line 18, in <module>
      from setuptools.dist import Distribution
    File "/home/expert-bot/python3_ws/py3venv/lib/python3.8/site-packages/_virtualenv.py", line 89, in exec_module
      old(module)
    File "/home/expert-bot/python3_ws/py3venv/lib/python3.8/site-packages/setuptools/dist.py", line 37, in <module>
      from setuptools import windows_support
    File "/home/expert-bot/python3_ws/py3venv/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'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3b/95/88ed47cb7da88569a78b7d6fb9420298df7e99997810c844a924d96d3c08/empy-3.3.4.tar.gz#sha256=73ac49785b601479df4ea18a7c79bc1304a8a7c34c02b9472cf1206ae88f01b3 (from https://pypi.org/simple/empy/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached empy-3.3.2.tar.gz (138 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/expert-bot/python3_ws/py3venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-04mt1wt_/empy_104fd15b7f9e408eb4a702d46fe5de03/setup.py'"'"'; file__='"'"'/tmp/pip-install-04mt1wt_/empy_104fd15b7f9e408eb4a702d46fe5de03/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-_fwmqok0
       cwd: /tmp/pip-install-04mt1wt_/empy_104fd15b7f9e408eb4a702d46fe5de03/
  Complete output (13 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/home/expert-bot/python3_ws/py3venv/lib/python3.8/site-packages/setuptools/__init__.py", line 18, in <module>
      from setuptools.dist import Distribution
    File "/home/expert-bot/python3_ws/py3venv/lib/python3.8/site-packages/_virtualenv.py", line 89, in exec_module
      old(module)
    File "/home/expert-bot/python3_ws/py3venv/lib/python3.8/site-packages/setuptools/dist.py", line 37, in <module>
      from setuptools import windows_support
    File "/home/expert-bot/python3_ws/py3venv/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'
  ----------------------------------------
WARNING: Discarding
https://files.pythonhosted.org/packages/b7/56/72a285d257c7791616960493a04f14c05ca1bf7a83dd208485cf991563bd/empy-3.3.2.tar.gz#sha256=99f016af2770c48ab57a65df7aae251360dc69a1514c15851458a71d4ddfea9c (from https://pypi.org/simple/empy/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement empy (from versions: 3.3.2, 3.3.4)
ERROR: No matching distribution found for empy 

解决这一问题的可能办法是什么?

EN

回答 1

Stack Overflow用户

发布于 2022-01-26 22:50:37

看起来您的Python缺少了_ctypes模块,但我认为empy会在此之后安装。我相信_ctypes (它依赖于libffi)在安装Python本身时就已经内置到Python中了。如果您自己安装了Python,然后安装了libffi,那么尝试重新安装Python。它甚至会在终端中写出它构建的“可选”模块,在这里,_ctypes应该是其中之一。

哦,如果Python脚本很难找到libffi,那么提供configure并将libffi include目录添加到CPPFLAGS,并将libffi lib目录添加到LDFLAGSLD_LIBRARY_PATH,例如。

代码语言:javascript
运行
复制
export CPPFLAGS="-I/path/to/libffi/include ${CPPFLAGS}"
export LDFLAGS="-L/path/to/libffi/lib -Wl,-rpath=/path/to/libffi/lib ${LDFLAGS}"
export LD_LIBRARY_PATH="/path/to/libffi/lib:${LD_LIBRARY_PATH}"
 ./configure --with-system-ffi ...
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70870990

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档