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 项目(不同的解释


基础教程推荐
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 筛选NumPy数组 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01