0

I am new to coding. I installed anaconda2 and installed python36 as a environment in anaconda2. And I activate python36 in the anaconda prompt. Then, I run the following codes on pycharm to test whether my version is switched to python36.

print('3 / 2 =', 3 / 2)

It returns

3 / 2 = 1

The result supposed to be 1.5. Seems it doesn't work.

Is there any thing wrong with my steps? Can I switch version which runs in IDE by activate py36 in prompt?

Another question is what is the difference between anaconda3 and anaconda2 which activated python3.x? Do I need download anaconda3 and switch interpreter in my IDE sitting?

Chao Song
  • 103
  • 2
  • 1
    You need to change the project interpreter in PyCharm to anaconda's interpreter. And, btw you can always run your scripts in anaconda's ide named Spyder. – Kishor Oct 15 '17 at 05:09
  • @Kishor Thank you. What the activate command for? Only activate py36 in prompt? – Chao Song Oct 15 '17 at 05:23
  • 1
    google it! I think you can go to Settings -> Project -> Project Interpreter and change the interpreter. I am not sure though. Just give it a try. – Kishor Oct 15 '17 at 05:24

1 Answers1

1

Activating an environment at the command line has no impact on the environment loaded by PyCharm. This is covered in Is it ok having both anacondas 2.7 and 3.5 installed in the same time. The gist is, you can choose the environment in PyCharm in the Project Interpreters section of the Settings/Preferences dialog box. See Conda Support Creating Conda Environments for more details.

Grr
  • 15,553
  • 7
  • 65
  • 85