首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用自动创建轮子

无法使用自动创建轮子
EN

Stack Overflow用户
提问于 2021-08-26 01:49:26
回答 1查看 793关注 0票数 1

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

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

为了解决这个问题,我决定遵循主站点上的说明:https://pypi.org/project/autopy/

我试过第一个

代码语言:javascript
复制
pip install autopy

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

从那里,我转到了第二个选项:

代码语言:javascript
复制
rustup default nightly-2019-10-05
pip install -U setuptools-rust
pip install -U autopy

通过安装rustup并运行其他命令,但它仍然失败,并给出"failed to build wheel“和setup.py failed错误消息,与之前完全相同。

最后,我尝试了第三种选择:

代码语言:javascript
复制
git clone git://github.com/autopilot-rs/autopy-rs.git
cd autopy
make
make install

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

我已经尝试了所有的3种方法,互联网只取得了最低限度的效果,这里的任何帮助或资源可能会有帮助,非常感谢。

编辑:很抱歉,我以为我添加了错误,这就是

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

发布于 2021-08-26 01:55:45

查看AutoPy的存储库,我发现了这个问题here

你有没有尝试过在Python3或更高版本上使用pip install autopy3?此外,autopy使用rust cargo,您可以尝试克隆以下repo,并尝试在您的平台上使用Rust (cargo build)构建它?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68931579

复制
相关文章

相似问题

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