Use Conda environment in pycharm

后端 未结 6 2002
南方客
南方客 2020-11-28 05:41

Conda env is activated using source activate env_name.

How can I activate the environment in pycharm ?

6条回答
  •  一向
    一向 (楼主)
    2020-11-28 06:01

    It seems important to me to know, that setting project interpreter as described in wasabi's comment does not actually activate the conda environment.

    I had issue with running xgboost (that I installed with conda) inside PyCharm and it turned out that it also need some folders added to PATH. In the end I had to make do with an ugly workaround:

    1. Find out what are the additional folders in PATH for given environment (with echo %PATH% in cmd)

    2. In the file I wish to run put to the top before anything else:

    import os os.environ["PATH"] += os.pathsep + os.pathsep.join(my_extra_folders_list)

    I know this is not at all proper solution, but i was unable to find any other beside what Mark Turner mentioned in his comment.

提交回复
热议问题