首页 > 解决方案 > 为什么在 PyCharm 中安装 AutoPy 时会出错

问题描述

当我尝试通过项目解释器的 PyCharm 设置安装 AutoPy 时,出现如下问题:

ERROR: Command errored out with exit status 1:
     command: 'D:\HAI\WORKING FILE\MIT\GITHUB\HandTracking\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\PC3\\AppData\\Local\\Temp\\pip-install-ocq7kz7k\\autopy_525204e28b184b6faa3ce4e1e142b467\\setup.py'"'"'; __file__='"'"'C:\\Users\\PC3\\AppData\\Local\\Temp\\pip-install-ocq7kz7k\\autopy_525204e28b184b6faa3ce4e1e142b467\\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 'C:\Users\PC3\AppData\Local\Temp\pip-pip-egg-info-6v2ei_1h'
         cwd: C:\Users\PC3\AppData\Local\Temp\pip-install-ocq7kz7k\autopy_525204e28b184b6faa3ce4e1e142b467\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\PC3\AppData\Local\Temp\pip-install-ocq7kz7k\autopy_525204e28b184b6faa3ce4e1e142b467\setup.py", line 8, in <module>
        from setuptools_rust import Binding, RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3d/3e/e589bfe03c7ee1c3d832dda10b908557f25a09d66acfc8fc7d982ee23d1a/autopy-4.0.0.tar.gz#sha256=b889dc1245426aa06769d3d87df0d96904ca729d0e9441a0096aa3ae9fbae43f (from https://pypi.org/simple/autopy/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    ERROR: Command errored out with exit status 1:
     command: 'D:\HAI\WORKING FILE\MIT\GITHUB\HandTracking\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\PC3\\AppData\\Local\\Temp\\pip-install-ocq7kz7k\\autopy_7b77c3cf26ae4222a7b1929a1ea58941\\setup.py'"'"'; __file__='"'"'C:\\Users\\PC3\\AppData\\Local\\Temp\\pip-install-ocq7kz7k\\autopy_7b77c3cf26ae4222a7b1929a1ea58941\\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 'C:\Users\PC3\AppData\Local\Temp\pip-pip-egg-info-jl7ffro3'
         cwd: C:\Users\PC3\AppData\Local\Temp\pip-install-ocq7kz7k\autopy_7b77c3cf26ae4222a7b1929a1ea58941\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\PC3\AppData\Local\Temp\pip-install-ocq7kz7k\autopy_7b77c3cf26ae4222a7b1929a1ea58941\setup.py", line 8, in <module>
        from setuptools_rust import Binding, RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    ----------------------------------------

截图错误

像这样的一些更新:我已经安装了“rustup default nightly-2019-10-05-x86_64-pc-windows-msvc”

C:\Users\PC3>rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\PC3\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc
nightly-2019-10-05-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-msvc

active toolchain
----------------

nightly-2019-10-05-x86_64-pc-windows-msvc (default)
rustc 1.40.0-nightly (2e7244807 2019-10-04)

标签: pythonpycharmautopy

解决方案


推荐阅读