如何在更新较新的Python版本后迁移所有软件包,设置,用户数据等?
我刚刚在Windows 10上安装了Python 3.10,我的脚本都没有工作。例如,当做jupyter笔记本
时,我得到了
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
我一直在使用python 3.9,所有脚本仍然位于c:\ program Files \ Python39 \ scripts
中。但是,c:\ program Files \ Python310 \ Scripts
(除pip
)中没有什么。
作为解决问题的首次尝试,我卸载了Python 3.10仅留下3.9。但这无济于事 - 意味着安装较新的Python版本将使您的整个开发框架砖砌!
问题:
- 什么是使所有内容恢复运行的最佳方法,我是否必须将所有内容从3.9目录到3.10目录迁移?即,仅复制
\ scripts
文件夹的内容,或者是否有更多散布的文件夹? - 那么对包装进行的所有自定义,例如
jupyter
中的用户设置,如何保存/迁移?
我有些惊讶的是,Python不会自动处理此问题,即保持自己的“无状态”,并将所有软件包保存到一个单独的(“状态”)用户文件夹中,然后只需自动将此用户文件夹添加到Python路径即可。更新整个开发框架是否不负责任?
现在的处理方式似乎是一个生产力杀手。我不想重新安装和重新配置我的整个代码库,所有软件包,依赖项,设置等。每次有新的Python版本。 肯定必须有一种“正统”方式正确处理?
I've just installed Python 3.10 on Windows 10 and none of my scripts are working. For instance, when doing jupyter notebook
I get
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
I've been using Python 3.9 and all the scripts are still located in C:\Program Files\Python39\Scripts
. However, there is nothing in C:\Program Files\Python310\Scripts
(besides pip
).
As a first attempt to solve the problem, I uninstalled Python 3.10 leaving only 3.9. But this didn't help - meaning that installing a newer Python version will brick your entire developing framework!
Question:
- What is the optimal way to get everything back operational, do I have to migrate everything from 3.9 directories to 3.10 directories? I.e. would it suffice to just copy over the content of the
\Scripts
folder to the newer version or are there more folders scattered about? - And what about all the customizations done to packages, e.g. user settings in
Jupyter
, how can they be preserved/migrated?
I'm a little surprised that Python doesn't handle this issues automatically, i.e. keep itself "stateless" and save all packages into a separate ("stateful") user folder, then just automatically add this user folder to the Python path. Isn't it wildly irresponsible to have updates brick the entire development framework?
The way it is handled now seems like a productivity killer. I don't want to reinstall and reconfigure my entire code base, all packages, dependencies, settings etc. every time there is a new Python version. Surely there must be an "orthodox" way how this is dealt with properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我可以报告挽救工作系统的部分成功:卸载较新的Python版本,删除所有新添加的路径条目,重新启动似乎至少是为了使Jupyter重新恢复运行。
这意味着安装较新的Python版本只能 soft - 砖系统。删除更新可能会恢复旧版本的功能。也许这将有助于有人解决同样的问题。
这并不能解决更新和迁移包裹的问题 - “移动东西”的正确,规范,正统的方式是什么?
Okay, I can report a partial success in rescuing my working system: Uninstalling the newer Python version, removing all newly added PATH entries and rebooting seems at least to get Jupyter back operational.
This means that installing newer Python version will only soft-brick your system. Removing updates may restore the functioning of your old version. Maybe this will help somebody struggling with the same problem.
This doesn't solve the issue of updating and migrating your packages - what is the proper, canonical, orthodox way for "moving your stuff"?