[英]I need to set up an python interpreter when i clone a repo on pycharm
when I clone a github repository to my pycharm it says that I don't have any python interpreters for that project, but when I open the terminal (pycharm terminal) and type "python name_of_the_file.py" it runs the program without problems.当我将 github 存储库克隆到我的 pycharm 时,它说我没有该项目的任何 python 解释器,但是当我打开终端(pycharm 终端)并键入“python name_of_the_file.py”时,它可以毫无问题地运行程序。 Do I have to set up a python interpreter for the project or not?我是否必须为项目设置 python 解释器?
ps: pycharm doesn't give any kind of error when I import some module for that project (bult-in module and not bult-in modules) ps:当我为该项目导入某个模块(内置模块而不是内置模块)时,pycharm 不会出现任何类型的错误
You just need to tell PyCharm where your Python interpreter is.你只需要告诉 PyCharm 你的 Python 解释器在哪里。 Go to File -> Project Structure -> Project and select a Project SDK.转到文件 -> 项目结构 -> 项目并选择一个项目 SDK。 I suggest creating a new virtual environment for each project.我建议为每个项目创建一个新的虚拟环境。
Opening the terminal and typing python
uses the system's PATH
variable to find the executable.打开终端并输入python
使用系统的PATH
变量来查找可执行文件。 PyCharm doesn't use this automatically and you have to set it up. PyCharm 不会自动使用它,您必须对其进行设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.