简体   繁体   中英

import graphviz works in jupyter notebook, but the same code does not work in Pycharm

import graphviz works in jupyter notebook, but the same code does not work in Pycharm. I tried to setup an anaconda environment which includes graphviz and I am using that particular python interpreter from pycharm. I am stuck with this problems for last 24 hours, please help..? 在此处输入图像描述

在此处输入图像描述

Try creating a new project, than choose "Previously configured interpreter". Check if the Python exe within the correct enviroment is selected. So in "Users/UserName/anaconda3/envs/Python/python.exe". Than when the new project is created you can check in the terminal if the correct env is enabled by looking for the term in the brackets. (Should by "Python" for you). Than try to import graphviz in the Python Console. If this works your file has a wrong configuration. Copy it in the new project and add the correct Configuration. Tried this and it works for me. Hope I could help and good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM