简体   繁体   English

如何阻止 Anaconda Navigator 和 Spyder 将库放入用户文件夹

[英]How to stop Anaconda Navigator and Spyder from dropping libraries into User folder

For reference, I'm trying to re-learn programming and python basics after years away.作为参考,我试图在多年之后重新学习编程和 Python 基础知识。

I recently downloaded Anaconda as part of an online Python Course.我最近下载了 Anaconda 作为在线 Python 课程的一部分。 However, every time I open Spyder or the Navigator they instantly create folders for what I assume are all the relevant libraries in C:Users/Myself.但是,每次我打开 Spyder 或导航器时,它们都会立即为我认为是 C:Users/Myself 中的所有相关库创建文件夹。 These include .conda, .anaconda, .ipython, .matplotlib, .config and .spyder-py3.其中包括 .conda、.anaconda、.ipython、.matplotlib、.config 和 .spyder-py3。

My goal is to figure out how change where these files are placed so I can clean things up and have more control.我的目标是弄清楚如何更改这些文件的放置位置,以便我可以清理内容并进行更多控制。 However, I am not entirely sure why this occurs.但是,我不完全确定为什么会发生这种情况。 My assumption is it's due to that being the default location for the Working Directory, thought the solutions I've seen to that are currently above me.我的假设是因为这是工作目录的默认位置,认为我所看到的解决方案目前在我之上。 I'm hoping this is a separate issue with a simpler solution, and any light that can be shed on this would be appreciated.我希望这是一个具有更简单解决方案的单独问题,并且可以对此有所了解,我们将不胜感激。

They are automatically created to store configuration changes for those related tools.它们会自动创建以存储这些相关工具的配置更改。 They are created in %USERPROFILE% under Windows.它们是在 Windows 下的%USERPROFILE%中创建的。

The following is NOT recommended:不推荐以下内容:

You can change this either via the setx command or by opening the Start Menu search for variables .您可以通过setx命令或打开开始菜单搜索variables来更改此设置。
- This opens the System Properties menu on the Advanced tab - Click on Environmental Variables - Under the user section, add a new variable called USERPROFILE and set the value to a location of your choice. - 这将打开高级选项卡上的系统属性菜单 - 单击环境变量 - 在用户部分下,添加一个名为USERPROFILE的新变量并将值设置为您选择的位置。

Go to:去:

~\\anaconda3\\Lib\\site-packages\\jupyter_core\\paths.py ~\\anaconda3\\Lib\\site-packages\\jupyter_core\\paths.py

in def get_home_dir():在 def get_home_dir() 中:

You can specify your preferred path directly.您可以直接指定首选路径。

Other anaconda applications can be mortified by this way but you have to find out in which scripts you can change the homedir, and sometimes it has different names.其他 anaconda 应用程序可能会以这种方式受挫,但您必须找出可以在哪些脚本中更改 homedir,有时它具有不同的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM