Pycharm中Python版本的设置

Chinese and English word transferring are too bothering for me. So i'll just use Eng after.

 

Set Python Env

Before open or creat any project you can find preference button below the Pycharm window. It will be setted in every Proj not just specific one. I used Python 2.7 before because my ML teacher told us to and I now realize 2.7 will be dead in 2020 and it's already stop releasing updates. So adding a new env for Pycharm is needed. I downloaded Python 3.7(24/11/18 newest) on its offical website and found it compatible with Python 2.7 on my Mac so it's easier for me not to uninstall the old version, and it may helps for future project, who know XD.

 

Change Pycharm Setting

Find the "Project Interpreter" button on the side bar, and click the slide down button on the right. You wont find new Python3 on the table but that's totally fine. Click on the "show all" and then the "+" button to add your new envs. You'll get to pick add remote or localy. Since i dont use docker or not participate in any composing proj right now I'll choose "add localy". Let's just put add remotely for further discussion okay?(//TODO! biggest joke ever XD)

Then you'll find three options. 

  1. First i dont know, it looks like a virtual enviroment maybe a docker or cloud env. I'll find that out in the future. This is honestly.
  2. Second is the thing i use. It's from Anaconda Navigator. I too created an env for Python3 cuz i used 2 on it once and then i have to get this new version on everywhere. I picked "Existing env" and directed it into my Python3 env.
  3. Third one is from System. Choose third one. It's added from the moment you install the P3. So it will automatically shows on the side and you get to choose more. I think most user should pick that. Cuz anaconda is really a burden for newbees(me) from my point.

 

Error I get

I tried to re-create that error for getting a snap picture but it magically gone, well, okay anyway...

After picked an env, i got an error says:

Cannot Save Settings please use a different SDK name

  1. I first rename my new interpreter to "Pythona 3.7" but it seems doesnt help.
  2. Then I deleted all red interpreter which all shows[invalid] on the side and they are all Python. Then it works out.

 

Other way to fix[or If you want to get rid of "venv"]

If you dont want to change interpreter for every proj or want to developing new way. You can try to initalize it from any begining of a proj. It will create an file called "venv" in proj. This will answer the question from[1] and it's new in pycharm. If you want to stick to old fashioned way(i like to), and dont want your file system having something you dont even know, just choose below "Existing interpreter".

 

I've only learnt it for two days so if there are anything wrong please let me know. Much Appreciated!❤️

 

references:

[1]https://stackoverflow.com/questions/47932725/configuring-interpreter-in-pycharm-please-use-a-different-sdk-name

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值