我看了一篇(非常稀少的)有关Anaconda的教程,然后试着做了以下操作:
$ conda create -n rootclone --clone root
这个失败了:
src_prefix: '/home/bir/conda'
dst_prefix: '/home/bir/conda/envs/rootclone'
Packages: 49
Files: 471
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:
https://github.com/conda/conda/issues
Include the output of the command 'conda info' in your report.
Traceback (most recent call last):
File "/home/bir/conda/bin/conda", line 5, in <module>
sys.exit(main())
File "/home/bir/conda/lib/python2.7/site-packages/conda/cli/main.py", line 203, in main
args_func(args, p)
File "/home/bir/conda/lib/python2.7/site-packages/conda/cli/main.py", line 208, in args_func
args.func(args, p)
File "/home/bir/conda/lib/python2.7/site-packages/conda/cli/common.py", line 609, in inner
return func(args, parser)
File "/home/bir/conda/lib/python2.7/site-packages/conda/cli/main_create.py", line 50, in execute
install.install(args, parser, 'create')
File "/home/bir/conda/lib/python2.7/site-packages/conda/cli/install.py", line 170, in install
clone(args.clone, prefix, json=args.json, quiet=args.quiet)
File "/home/bir/conda/lib/python2.7/site-packages/conda/cli/install.py", line 91, in clone
quiet=quiet)
File "/home/bir/conda/lib/python2.7/site-packages/conda/misc.py", line 177, in clone_env
data = s.encode('utf-8')
MemoryError
糟糕。环境已经被创造出来:
$ conda info -e
# conda environments:
#
oracle /home/bir/conda/envs/oracle
oracleclone /home/bir/conda/envs/oracleclone
rootclone /home/bir/conda/envs/rootclone
root * /home/bir/conda
但是它根本不起作用:
$ . activate rootclone
discarding /home/bir/conda/bin from PATH
prepending /home/bir/conda/envs/rootclone/bin to PATH
(rootclone)bir@N2C:~/python$ which python
/usr/bin/python # Should be in /home/bir/conda/envs/rootclone/bin
但这是一个真正的 bug 吗,还是 conda create -n --clone
只是不适用于克隆 conda 根环境?
/home/bir/conda
复制到/home/bir/conda/envs/rootclone
。该实用程序将尝试递归复制,因此/home/bir/envs/rootclone
下的所有文件也将被复制到/home/bir/envs/rootclone/envs/rootclone
下,并且这些文件将被复制到/home/bir/envs/rootclone/envs/rootclone/envs/rootclone
下。这是一个无限递归。 - alvits