我是python和pycharm工具的新手。我创建了一个项目,并在Git Hub中签入。现在,我的一位朋友撤消了更改并尝试运行,他遇到了一条错误消息,指出“未找到解释器”。当我重新验证项目结构时,我发现我的项目中有'venv'文件夹,但是进行更改的人拥有它。
你能帮我这个忙吗?
提前致谢!
PS:我正在使用Windows OS
我是python和pycharm工具的新手。我创建了一个项目,并在Git Hub中签入。现在,我的一位朋友撤消了更改并尝试运行,他遇到了一条错误消息,指出“未找到解释器”。当我重新验证项目结构时,我发现我的项目中有'venv'文件夹,但是进行更改的人拥有它。
你能帮我这个忙吗?
提前致谢!
PS:我正在使用Windows OS
通常,您不检入venv文件夹。
Save the output of
pip freeze
in a file calledrequirements.txt
and check that into your repo.Once your friend gets the full code, they can install the dependencies using
pip install -r requirements.txt
正如您所说的那样,您是Python的新手,我将尝试解释Python项目中的工作原理。
在另一台计算机上进行设置的步骤。
pip freeze
and write them to a text file which contains library names and versions. Add this file to your project. Convention is to name it asrequirements.txt
. Refer this https://pip.pypa.io/en/stable/reference/pip_freeze/Note: It's not suggested to have venv folder which contains all your packages inside your project directory itself. You may have to add the folder to
.gitignore
just for this purpose.