在anaconda虚拟环境下下载CVXPY包

 windows环境下

一、首先激活环境

  activate your_env_name

二、下载cvxpy

  pip install cvxpy

  

 三、在pycharm中切换Interpreter(解释器)

  File->Settings->Project->Project Interpreter

  也可在Settings中通过搜索框搜索Interpreter

  

四、可能遇到的问题

   下载cplex包时遇到的问题

  

  解决方案:

  使用国内镜像源:参考(https://blog.csdn.net/qq_27061325/article/details/89916450?utm_medium=distribute.pc_relevant.none-task-blog-title-3&spm=1001.2101.3001.4242

  1. Windows

  在'C:\Users\<usename>' 目录下新建目录 'pip',再进入此 'pip' 目录,添加 'pip.ini' 文件,文件内容为:

重新打开cmd。

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

   2. Linux

  在用户目录(比如 '/workspace/ccx/')下新建目录 '.pip',再进入此 '.pip' 目录添加文件 ‘pip.conf’,文件内容为:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

  

  遇到importError DLL load failed

  尝试在pychar添加环境变量PATH={Anaconda3的路径}\Library\bin

  Run->Edit Configurations...

  

posted @ 2020-09-04 16:26  Shelly,  阅读(1117)  评论(0)    收藏  举报