1

我最近很无聊,所以我决定做一些编程并遵循这个看起来很有趣的教程:https ://www.youtube.com/watch?ev=8gPONnGIPgw&t=244s

在此期间,他autopy直接从 安装模块pycharm,但是当我直接从设置中自己尝试时,pycharm它不起作用并且我收到错误消息。

为了解决这个问题,我决定按照主站点上的说明进行操作:https ://pypi.org/project/autopy/

我尝试了第一个

pip install autopy

直接命令并得到一个巨大的错误,它首先说它未能构建轮子,然后当它运行第二部分时,setup.py它也给出了一个巨大的错误,说它也失败了。

从那里我去了第二个选项:

rustup default nightly-2019-10-05
pip install -U setuptools-rust
pip install -U autopy

通过安装rustup和运行其他命令,但它仍然失败并给出“未能构建轮子”和 setup.py 失败错误消息,与以前完全相同。

最后我尝试了第三个选项:

git clone git://github.com/autopilot-rs/autopy-rs.git
cd autopy
make
make install

通过下载存储库本身然后进入它并使用make(我通过chocolatey安装powershell)并运行这些命令,但它也失败了。

我已经尝试了所有 3 种方法,并且互联网产生了最小的结果,非常感谢这里的任何帮助或可能有帮助的资源。

编辑:抱歉,我以为我添加了错误,在这里

Collecting autopy
  Using cached autopy-4.0.0.tar.gz (20 kB)
Building wheels for collected packages: autopy
  Building wheel for autopy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\moham\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\setup.py'"'"'; __file__='"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\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'"'"'))' bdist_wheel -d 'C:\Users\moham\AppData\Local\Temp\pip-wheel-bt_24b82'
       cwd: C:\Users\moham\AppData\Local\Temp\pip-install-9plfhi_h\autopy_f9372250d2954cabaa93abb9058afa97\
  Complete output (21 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\autopy
  copying autopy\__init__.py -> build\lib\autopy
  running build_ext
  running build_rust
  error: no override and no default toolchain set
  error: can't find Rust compiler

  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

  To update pip, run:

      pip install --upgrade pip

  and then retry package installation.

  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  ----------------------------------------
  ERROR: Failed building wheel for autopy
  Running setup.py clean for autopy
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\moham\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\setup.py'"'"'; __file__='"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\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'"'"'))' clean --all
       cwd: C:\Users\moham\AppData\Local\Temp\pip-install-9plfhi_h\autopy_f9372250d2954cabaa93abb9058afa97
  Complete output (18 lines):
  running clean
  removing 'build\lib' (and everything under it)
  'build\bdist.win-amd64' does not exist -- can't clean it
  'build\scripts-3.9' does not exist -- can't clean it
  removing 'build'
  running clean_rust
  error: no override and no default toolchain set
  error: can't find Rust compiler

  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

  To update pip, run:

      pip install --upgrade pip

  and then retry package installation.

  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  ----------------------------------------
  ERROR: Failed cleaning build dir for autopy
Failed to build autopy
Installing collected packages: autopy
    Running setup.py install for autopy ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\moham\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\setup.py'"'"'; __file__='"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\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'"'"'))' install --record 'C:\Users\moham\AppData\Local\Temp\pip-record-lgc9_ekn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\moham\appdata\local\programs\python\python39\Include\autopy'
         cwd: C:\Users\moham\AppData\Local\Temp\pip-install-9plfhi_h\autopy_f9372250d2954cabaa93abb9058afa97\
    Complete output (21 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\autopy
    copying autopy\__init__.py -> build\lib.win-amd64-3.9\autopy
    running build_ext
    running build_rust
    error: no override and no default toolchain set
    error: can't find Rust compiler

    If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

    To update pip, run:

        pip install --upgrade pip

    and then retry package installation.

    If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\moham\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\setup.py'"'"'; __file__='"'"'C:\\Users\\moham\\AppData\\Local\\Temp\\pip-install-9plfhi_h\\autopy_f9372250d2954cabaa93abb9058afa97\\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'"'"'))' install --record 'C:\Users\moham\AppData\Local\Temp\pip-record-lgc9_ekn\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\moham\appdata\local\programs\python\python39\Include\autopy' Check the logs for full command output.
4

1 回答 1

0

Looking at the repository for AutoPy, I've found this issue here

Have you tried to use pip install autopy3 for python 3 and above? Furthermore, autopy uses rust cargo, you can try to clone the following repo and try to build it with Rust (cargo build) on your platform?

于 2021-08-26T01:55:45.323 回答