简体   繁体   English

当我在 pycharm 上克隆一个 repo 时,我需要设置一个 python 解释器

[英]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.

相关问题 为什么在我启动 Pycharm 时弹出 python 设置,我的 python 解释器在哪里? - Why is python setup popping up when I start Pycharm and where is my python interpreter? 当我在Pycharm中创建新的python文件时,是否可以包含解释器路径(或设置任何默认代码)? - Is it possible to include interpreter path (or set any default code) when I create new python file in Pycharm? 我已经正确设置了 PyCharm 解释器,但是当运行代码时,它显示在运行 window PyCharm 使用另一个 Z23EEEB4347BDD25DDAZBexe 之前使用9EEE73BDD25DDAZBexe。 - I have set PyCharm interpreter right but when run the code, it shows in the run window PyCharm uses another python.exe I used before 如何为Mercurial Hooks的pyCharm设置python解释器 - How to set up python interpreter for pyCharm for Mercurial Hooks 将 PyCharm Python 解释器设置为 Docker - Set PyCharm Python interpreter to Docker 当我按箭头键时,^[[A 和 ^[[B 出现在 python 解释器中 - ^[[A and ^[[B show up in python interpreter when I press arrow keys 为什么在 Windows 机器上使用 PyCharm 时不能使用基于 Linux 的 Python 解释器? - Why can't I use a Linux-based Python interpreter when using PyCharm on a Windows machine? 没有 Python 解释器配置:当我使用命令行打开 PyCharm 中的项目文件夹时 - No Python Interpreter Configured: When I open project folder in PyCharm using command line 在Windows的PyCharm中设置anaconda解释器 - Set up anaconda interpreter in PyCharm on Windows 使用 WSL Ubuntu 20.04 在 PyCharm 中设置解释器 - Set up the interpreter in PyCharm with WSL Ubuntu 20.04
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM