Share a PyCharm project across multiple operating systems (different interpreter paths)(跨多个操作系统共享一个 PyCharm 项目(不同的解释器路径))
问题描述
我刚刚开始使用 PyCharm.我一半时间花在 Windows 机器上,另一半时间花在 Linux 上.我一直在使用 Dropbox 在两者之间同步我的项目(除了版本控制).这大部分工作正常,除了每次切换操作系统时,我都必须重置 PyCharm 项目解释器,因为两个操作系统的路径不同.
I have just gotten in to using PyCharm. I spend half my time on a Windows machine and the other half on Linux. I have been using Dropbox to sync my projects between the two (in addition to version control). This mostly works fine, except each time I switch operating systems, I have to reset the PyCharm project interpreter, because the paths for the two operating systems are different.
我唯一的选择是拥有两个不同的工作副本,每个操作系统一个(即停止将 Dropbox 用于 PyCharm 项目)吗?或者,有什么方法可以让 PyCharm 使用多个 Python 解释器并回退到一个可以工作的解释器上,这样我就可以将 Windows 和 Linux 配置存储在一个 PyCharm 项目文件中并让它自动工作?
Is my only option to have two different working copies, one for each operating system (i.e. stop using Dropbox for PyCharm projects)? Or, is there some way to get PyCharm to use multiple Python interpreters and fall-back on one that works, so that I can store both the Windows and the Linux configuration in a single PyCharm project file and have it work automatically?
推荐答案
使用设置| 中的编辑"按钮两台机器上的 Python 解释器将解释器重命名为不包含完整路径的名称(例如Python 2.7").项目文件存储解释器的名称,而不是路径,因此这将允许项目文件在两台机器上引用相同的解释器.
Use the "Edit" button in Settings | Python Interpreters on both machines to rename the interpreter to something that doesn't include the full path ("Python 2.7" for example). The project file stores the name of the interpreter, not the path, so this will allow the project file to reference the same interpreter on both machines.
这篇关于跨多个操作系统共享一个 PyCharm 项目(不同的解释器路径)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:跨多个操作系统共享一个 PyCharm 项目(不同的解释
基础教程推荐
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
