乐鑫技术交流
直播中

王秀珍

8年用户 1547经验值
私信 关注
[问答]

WSL2下VSCode插件安装失败的原因?

Collecting gevent<2.0,>=1.2.2 (from gdbgui==0.13.2.0->-r /home/qinge/esp/esp-idf/requirements.txt (line 26))
  Using cached gevent-1.5.0.tar.gz (5.3 MB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
Installing Python packages from /home/qinge/esp/esp-idf/requirements.txt
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [315 lines of output]
      Compiling src/gevent/resolver/cares.pyx because it changed.
      [1/1] Cythonizing src/gevent/resolver/cares.pyx
      performance hint: src/gevent/libev/corecext.pyx:1291:5: Exception check on '_syserr_cb' will always require the GIL to be acquired.
      Possible solutions:
          1. Declare '_syserr_cb' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
          2. Use an 'int' return type on '_syserr_cb' to allow an error code to be returned.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
                  raise ValueError('illegal event mask: %r' % events)
              # All the vfd_functions are no-ops on POSIX
              cdef int vfd = libev.vfd_open(fd)
              libev.ev_io_init(&self._watcher, gevent_callback_io, vfd, events)
              self.__watcher = &self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1027:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  raise ValueError('illegal event mask: %r' % events)
              # All the vfd_functions are no-ops on POSIX
              cdef int vfd = libev.vfd_open(fd)
              libev.ev_io_init(&self._watcher, gevent_callback_io, vfd, events)
              self.__watcher = &self._watcher
              self.__ss = &io_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1028:20: Cannot convert 'start_and_stop *' to Python object
                 

回帖(1)

符筹荣

2024-6-6 14:48:59
在WSL2下,VSCode插件安装失败可能有多种原因。根据您提供的错误信息,这个问题似乎与Python包的安装有关。以下是一些建议来解决这个问题:

1. **检查Python环境**:确保您的Python环境已正确设置。在WSL2中,您可能需要使用Linux版本的Python。

2. **更新pip**:确保您的pip是最新版本。在终端中运行以下命令来更新pip:
   ```
   python3 -m pip install --upgrade pip
   ```

3. **检查依赖关系**:错误信息显示,它正在尝试安装gevent包。确保您的系统中已安装所有必要的依赖项。您可以尝试手动安装gevent:
   ```
   python3 -m pip install gevent==1.5.0
   ```

4. **检查网络连接**:有时,网络问题可能导致安装失败。确保您的网络连接稳定。

5. **清理缓存**:清理pip缓存可能有助于解决安装问题。运行以下命令来清理缓存:
   ```
   python3 -m pip cache purge
   ```

6. **检查权限**:确保您有足够的权限来安装插件。如果您在安装过程中遇到权限问题,请尝试使用`sudo`命令。

7. **检查VSCode设置**:检查您的VSCode设置,确保Python解释器和环境变量已正确配置。

8. **查看日志**:查看VSCode的输出日志,以获取有关安装失败的更多详细信息。您可以在VSCode的“输出”面板中找到这些日志。

9. **尝试重新安装**:在解决了上述问题后,尝试重新安装插件。

10. **寻求帮助**:如果问题仍然存在,您可以在VSCode的GitHub仓库或相关社区论坛上寻求帮助。

请尝试这些建议,并根据需要调整您的环境设置。希望这些建议能帮助您解决问题。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分