目录
三、在pycharm中添加python的解释器(Conda executable is not found)
一、anaconda及pycharm安装
1、pycharm版本建议选择community版本,conda免费安装,此处安装的是如图1所示
图1:anaconda以及pycharm
2、 如果anaconda在安装过程中无法勾选anaconda3
这个会导致在后期环境配置过程中出现:conda : 无法将“conda”项识别为 cmdlet、函数、 脚本文件或可运行程序的名称
解决方案:安装结束后,手动添加conda的路径。在此电脑->属性->高级系统设置->环境变量,添加anaconda的安装路径下的script文件夹添加到系统的path环境变量中,比如D:\anaconda\Scripts(根据自己安装的路径)
二、环境配置过程中的问题
1、Cannot open Local Terminal Failed to start [powershell.exe] in F:\JetBrains\PyCharm\PycharmProjects\Reptiles house
Error running process: CreateProcess failed. Code 2
See IDE log (Help | Show Log in Explorer) for the details.
解决方案:在setting中设置shell path 为powershell 或者cmd的路径。注意(powershell和cmd都可以编辑配置环境,此处的terminal终端窗口只是接管了cmd或者powershell)
2、想要进入到环境当中,例如emo_rec,可以选择conda activate emo_rec,进入到base环境下
3、在conda激活环境的时候出现如下问题
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
不需要去conda init 环境,将激活命令更改为conda.bat activate emo_rec,就可以正常激活环境了。
4、 torch-geometric安装, 以及解决pycharm每次加载(updating skeletons),此处加载时间过长,需要耐心等待。未加载完成的时候右键运行程序是灰色的。
5、在terminal下输入conda 激活函数没有反应。例如下图所示。
解决方案:在cmd下激活环境。具体操作:win+r,输入cmd,然后在cmd下激活环境,例如:conda activate emo_rec,就可以解决了。
4、Process finished with exit code 1,所有的配置工作完成后,在运行是出现
“Process finished with exit code 1”。
解决方法:环境配置错误,重新配置环境
三、在pycharm中添加python的解释器(Conda executable is not found)
1、显示Conda executable is not found错误
解决方案:在Conda executable中选择conda的安装目录,如果选择_conda.exe,如果在目录里找不到_conda.exe,需要将_conda.exe,文件名更改为conda.exe,就可以搜索到,然后进行添加。