python - 错误:无法为使用 PEP 517 且无法直接安装的 cvxpy 构建轮子
问题描述
我在安装 CVXPY 时遇到了以下问题,我还下载了最新版本的 Visual Studio,但似乎也无法正常工作。
> C:\Anaconda3\lib\site-packages\numpy\distutils\system_info.py:1730:
> UserWarning:
> Lapack (http://www.netlib.org/lapack/) sources not found.
> Directories to search for the sources can be specified in the
> numpy/distutils/site.cfg file (section [lapack_src]) or by setting
> the LAPACK_SRC environment variable.
> return getattr(self, '_calc_info_{}'.format(name))()
> error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio":
> https://visualstudio.microsoft.com/downloads/
> {}
> {}
> ----------------------------------------
> ERROR: Failed building wheel for scs
> Running setup.py clean for scs
> Failed to build cvxpy ecos scs
> ERROR: Could not build wheels for cvxpy which use PEP 517 and cannot be installed directly
解决方案
我遇到了同样的问题。我必须创建一个新环境并安装它才能工作。转到 Anaconda Prompt,然后执行以下操作:
conda create your_env_name
conda activate your_env_name
conda install -c conda-forge cvxpy
conda install spyder
我在工作中使用 Spyder。我必须像第 4 步一样在新环境中安装 Spyder。我找不到解决方法来使用现有的 Spyder 在这两种环境下工作。
推荐阅读
- java - 无效的集合引用。集合引用必须有奇数个段
- azure-storage - Agora 云录制未在 azure 中保存视频
- radgrid - 将子网格中的总和动态分配给 Radgrid 中的父网格标题
- gitlab - git 合并问题:我的一个文件的更改在用户界面上的 git 合并中不可见
- flutter - 停止 Visual Studio Code 在异常时打开文件
- node.js - 为什么sequelize中没有Op.iSubString?
- jestjs - 为什么在开玩笑的单元测试中选择的修饰符不返回 true?
- android - 即使在更改 Kotlin 版本后,Android Studio 仍停留在“正在分析”
- azure - 使用 Azure Key Vault + AzureSignTool 签署文件
- javascript - 使用单选按钮有条件地渲染组件