atom怎么运行python_为什么Python无法在Atom中运行?

I've researched this on different places, including stackoverflow, and I can't find an answer that helps me.

I'm using Windows 7, 64 bit, with Atom for 64 bit Windows. I have Python 3.6.1 installed in the directory C:\Users\Austin\Documents\Python. When I try to run a simple script to test Python in Atom, it says

'python' is not recognized as an internal or external command,

operable program or batch file.

[Finished in 0.083s]

I tried to run the same script in the command line, and it said the same thing. I'm new to programming, so please try to be a little patient.

解决方案

Your issue is probably that your Python command is not listed in your PATH environment variable.

Environment Variables are paths, values and other information stored by your operating system and used globally by the OS and different applications you use.

The best example for a command listed in the PATH environment variable is cmd or ping. try to tap Win+R and type cmd, note how it opens a new Command Line even though you don't really know where cmd.exe is stored on your hard drive? That is because the path C:\Windows\System32 is stored in your PATH variable.

So, we know you installed python, but you want to be able to run it without specifying it's path, how can we do that? Simply add it to our environment variables:

Use the keyboard shortcut Win+Pause

Click on Advanced system settings

At the bottom of the window click on Environment Variables...

In the System Variables section find the PATH variable

Double click it

A new window with a text box has opened, go to it's end with the end button

Paste the path C:\Users\Austin\Documents\Python at it's end (be sure to add a ; before pasting if there isn't one there.

Click ok

Open a new cmd window

Try and type python you should be all set now, on the command line and in Atom.

If it isn't clear, the win button is the button on your keyboard with the windows icon on it.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值