英文:
Python script running in pycharm but not in cmd
问题
我在PyCharm中使用Python 3.9版本,脚本可以正常运行,但在cmd中输入python
时,它会打开Microsoft Store,显示Python 3.10页面。我需要为cmd授予某种对Python的权限吗?如何操作?
我在网上搜索过,但找不到在不重新下载的情况下使cmd运行Python的方法。
编辑:我想要将cmd用作终端,并能够通过它运行脚本。为了在cmd中使用Python终端,我输入python
,但cmd找不到它。这是Python的位置/路径:
C:\Users\ofira\AppData\Local\Programs\Python\Python39\python.exe
英文:
I use Pycharm with python version 3.9 and scripts run just fine,
but when I write python
in cmd, it opens Microsoft Store on the page of Python3.10.
Do I need to give cmd some kind of premission to python? How do I do that?
I searched online, but I couldn't find a way to make cmd run python without downloading it again.
edit: I want to use cmd as a terminal and to be able to run scripts through it.
In order to use cmd as python terminal I write python
but cmd can't find it.
This is the location/path of python:
C:\Users\ofira\AppData\Local\Programs\Python\Python39\python.exe
答案1
得分: 1
The solution is easy. When the Microsoft Store opens, type "python3.9" in the search tab. Download it, and everything will work like a charm. Downloading it from the store will automatically add the path to the system environment variable.
英文:
The solution is easy. When the microsoft store open's type python3.9 in the search tab. Download it and everything will work like a charm. Downloading it form the store will automatically add the path in the system environment variable.
答案2
得分: 1
I can't write a comment because my reputation is still low, but I was wondering if you were using Pycharm with an interpreter bundled with something like Anaconda (I did and I got the same problem as yours).
If this is the case, I solved it downloading the latest version of python from python.org (like this one) and proceeding with the installation.
You should be able to type python
on your prompt and run the interpreter with no effort.
Also, you can choose this new interpreter on Pycharm as well (just go on the lower right corner of the IDE and select it).
英文:
I can't write a comment because my reputation is still low, but I was wondering if you were using Pycharm with an interpreter bundled with something like Anaconda (I did and I got the same problem as yours).
If this is the case, I solved it downloading the latest version of python from python.org (like this one) and proceeding with the installation.
You should be able to type python
on your prompt and run the interpreter with no effort.
Also, you can choose this new interpreter on Pycharm as well (just go on the lower right corner of the IDE and select it).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论