漆黑天使复活 2023-04-23 21:22 采纳率: 44.4%
浏览 667
已结题

Windows环境下pip install tiktoken报错

window环境下,安装pip install tiktoken报错

C:\Users\leifeng1>pip install tiktoken
Collecting tiktoken
  Using cached tiktoken-0.3.3.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting regex>=2022.1.18 (from tiktoken)
  Using cached regex-2023.3.23-cp39-cp39-win32.whl (255 kB)
Requirement already satisfied: requests>=2.26.0 in c:\users\leifeng1\appdata\local\programs\python\python39-32\lib\site-packages (from tiktoken) (2.28.2)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\leifeng1\appdata\local\programs\python\python39-32\lib\site-packages (from requests>=2.26.0->tiktoken) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in c:\users\leifeng1\appdata\local\programs\python\python39-32\lib\site-packages (from requests>=2.26.0->tiktoken) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\leifeng1\appdata\local\programs\python\python39-32\lib\site-packages (from requests>=2.26.0->tiktoken) (1.25.11)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\leifeng1\appdata\local\programs\python\python39-32\lib\site-packages (from requests>=2.26.0->tiktoken) (2022.12.7)
Building wheels for collected packages: tiktoken
  Building wheel for tiktoken (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for tiktoken (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win32-cpython-39
      creating build\lib.win32-cpython-39\tiktoken
      copying tiktoken\core.py -> build\lib.win32-cpython-39\tiktoken
      copying tiktoken\load.py -> build\lib.win32-cpython-39\tiktoken
      copying tiktoken\model.py -> build\lib.win32-cpython-39\tiktoken
      copying tiktoken\registry.py -> build\lib.win32-cpython-39\tiktoken
      copying tiktoken\__init__.py -> build\lib.win32-cpython-39\tiktoken
      creating build\lib.win32-cpython-39\tiktoken_ext
      copying tiktoken_ext\openai_public.py -> build\lib.win32-cpython-39\tiktoken_ext
      running egg_info
      writing tiktoken.egg-info\PKG-INFO
      writing dependency_links to tiktoken.egg-info\dependency_links.txt
      writing requirements to tiktoken.egg-info\requires.txt
      writing top-level names to tiktoken.egg-info\top_level.txt
      reading manifest file 'tiktoken.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching 'Makefile'
      adding license file 'LICENSE'
      writing manifest file 'tiktoken.egg-info\SOURCES.txt'
      copying tiktoken\py.typed -> build\lib.win32-cpython-39\tiktoken
      running build_ext
      running build_rust
      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.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tiktoken
Failed to build tiktoken
ERROR: Could not build wheels for tiktoken, which is required to install pyproject.toml-based projects


根据提示,去装了pyproject.toml,装完之后继续报错,一样的错误,同时也试过装rust,也不行,报错

  • 写回答

6条回答 默认 最新

  • 语言-逆行者 2023-04-23 23:38
    关注

    试试?

    pip3 install tiktoken
    
    

    或者:在命令行中执行

    python -m pip install --upgrade pip 
    
    

    命令可以将 pip 更新到最新版。

    评论

报告相同问题?

问题事件

  • 系统已结题 5月1日
  • 创建了问题 4月23日

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?