anaconda是否为每个新环境创建一个单独的PYTHONPATH变量? [英] Does anaconda create a separate PYTHONPATH variable for each new environment?

查看:703
本文介绍了anaconda是否为每个新环境创建一个单独的PYTHONPATH变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开始使用Continuum.io的Anaconda软件包进行清洁工作。我已经能够获得anaconda的运行,但我不知道anaconda是否创建一个新的PYTHONPATH环境变量为它创建的每个新环境,还是依赖于普通系统PYTHONPATH?我在文档中找不到任何有关这方面的信息。此外,当我做了一个printenv,我没有看到新创建的环境中的PYTHONPATH变量 - 虽然我确实找到了一些新的anaconda创建的环境变量。我可以找到最好的是,anaconda在PATH变量的头部添加了一些蟒蛇目录和新的环境目录,但是这并不一定会将新的包与系统环境隔离开,而是很接近。有谁知道这个问题的答案或者找到一种方法来处理这个问题。

I am starting to work with the Anaconda package from Continuum.io to do scipy work. I have been able to get anaconda up and running, but I cannot tell whether anaconda creates a new PYTHONPATH environment variable for each new environment it creates, or whether it relies on the common system PYTHONPATH? I could not find any information on this in the documentation. Further, when I did a printenv, I did not see a PYTHONPATH variable in the newly created environment--though I did find a few new anaconda created environment variables. The best I can find is that anaconda added some anaconda directories and the new environment directory to the head of PATH variable--but this does not necessarily isolate the new package from the system environment but it is close. Does anyone know the answer to this question or found a way to deal with this concern.

推荐答案

不,唯一需要的要修改Anaconda环境是PATH(以便它从环境中获取正确的Python bin / 目录,或 Scripts\ 在Windows上)。

No, the only thing that needs to be modified for an Anaconda environment is the PATH (so that it gets the right Python from the environment bin/ directory, or Scripts\ on Windows).

Anaconda环境的工作方式是将所有安装到环境中的所有内容都链接起来。对于所有意图和目的,这意味着每个环境都是完全独立的Python和所有包的安装。通过使用硬链接,这是有效的。因此,不需要混淆PYTHONPATH,因为环境中的Python二进制文件已经在环境中的site-packages,环境的lib等中进行了搜索。

The way Anaconda environments work is that they hard link everything that is installed into the environment. For all intents and purposes, this means that each environment is a completely separate installation of Python and all the packages. By using hard links, this is done efficiently. Thus, there's no need to mess with PYTHONPATH because the Python binary in the environment already searches the site-packages in the environment, and the lib of the environment, and so on.

这篇关于anaconda是否为每个新环境创建一个单独的PYTHONPATH变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆