how to get conda environments to inherit root packages

2 просмотра
Перейти к первому непрочитанному сообщению

Jon Hauris

не прочитано,
22 дек. 2016 г., 12:31:0922.12.2016
– conda - Public
I have installed conda and it includes numpy, scipy, etc.
I then establish a conda env via: conda create -n tensorflow python=3.5
I then activate that conda via: source activate tensorflow
This puts me into the "tensorflow" env.
In (tensorflow)..., I enter python3 and get
>>>
Now if I do:
>>> import numpy as np  (or any other similar package)
if does not recognize numpy.

However it did allow me to import numpy in the root.
How do I get the conda env "tensorflow" to inherit all the packages (such as numpy, prettytensor, scipy, etc) from the root into that environment?
Thanks, (conda noob)

Michael Sarahan

не прочитано,
22 дек. 2016 г., 12:41:4222.12.2016
– Jon Hauris, conda - Public
There is no (good) way to inherit packages.  That's just likely to cause more problems than it is worth.

The good news is that adding packages to environments that are already installed in other environments (root env included) is practically free in terms of hard disk space.  Wherever possible, this is done with hard linking, so files are not actually copied, and do not occupy extra disk space.

My advice: install the other packages that you want to use into your new environment.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/19714d7d-4cf7-4b13-ba0f-e98ed58edf8d%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Chris Barker

не прочитано,
22 дек. 2016 г., 13:37:5922.12.2016
– Jon Hauris, conda - Public
On Thu, Dec 22, 2016 at 9:31 AM, Jon Hauris <rvr...@gmail.com> wrote:
I have installed conda and it includes numpy, scipy, etc.
I then establish a conda env via: conda create -n tensorflow python=3.5

This creates an essentially empty environment with only python3 and the core requirements for conda.

You need to then install whatever packages you need into that environment.

In this case, if you want to work with tensorflow, you can do:

conda install tensorflow

And it should bring in all its requirements as well.

If you want everything in the root environment, then there is no need to create an environment at all. The reason for environments is for working with multiple projects that require different versions of the same packages.

HTH,
 -CHB


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Bradley Kreider

не прочитано,
22 дек. 2016 г., 15:06:2722.12.2016
– conda - Public
You can "copy" an environment, although I don't think you want that.  I think you want to declaratively define your environment and tell conda to create it for you.  I haven't tested it, but it would look something like this:

conda create -n tensorflow --clone root

That would start you off with an environment that is a clone of your root environment.

Bradley

Ian Stokes Rees

не прочитано,
22 дек. 2016 г., 17:05:0622.12.2016
– Chris Barker, Jon Hauris, conda - Public

On 12/22/16 1:37 PM, Chris Barker wrote:

On Thu, Dec 22, 2016 at 9:31 AM, Jon Hauris <rvr...@gmail.com> wrote:
I have installed conda and it includes numpy, scipy, etc.
I then establish a conda env via: conda create -n tensorflow python=3.5

I think the question I would ask is “what are you trying to achieve with your tensorflow Conda environment?”

If you’re trying to create a software sandbox that is “everything in root + tensorflow” then you can do:

conda create -n mytensorflow --clone root
source activate mytensorflow
conda install tensorflow

If you’re trying to create a “minimal” environment that supports Tensorflow, then you should just do:

conda create -n tensorflowminimal tensorflow python=3.5
source activate tensorflowminimal

If you’re trying to create “Anaconda + Tensorflow” then:

conda create -n tensorflowanaconda tensorflow anaconda python=3.5
source activate tensorflowanaconda

Good luck and let us know if that gets you going or if you have more questions.

Ian

kaja salaam

не прочитано,
22 дек. 2016 г., 21:08:5622.12.2016
– conda - Public
conda create -n tensorflow-2.7 python=2.7 --copy
source activate tensorflow-2.7
conda install -c conda-forge tensorflow --copy

James Roberts

не прочитано,
19 янв. 2018 г., 02:25:3119.01.2018
– conda - Public, rvr...@gmail.com, msar...@gmail.com
If adding packages that are already installed on other environments doesn't double up on hard rive space, why did installing an explicitly py36 environment download everything when I already had python 3.6 installed as root?
For my second laptop, can I just rename root as py36? Or does there have to be a root for some reason?

Michael Sarahan

не прочитано,
19 янв. 2018 г., 08:59:0819.01.2018
– James Roberts, conda - Public, rvr...@gmail.com, Michael Sarahan
Re-downloads happen when there's new versions of packages, or when there are permission errors with linking.  Conda uses hard links, which only work on a single volume - if your environment is on a different volume from your root installation, you'll see copies or re-downloads.

The root environment is a concept, not a name of an actual place on disk.  You can install miniconda/anaconda anywhere you want, and that install location is what we call the "root" environment.  It is the only environment that can contain conda.  Renaming environments is highly likely to fail, because there are paths encoded into files that will no longer match, and your software will be very confused.

On Fri, Jan 19, 2018 at 1:25 AM, James Roberts <ja...@jkmail.net> wrote:
If adding packages that are already installed on other environments doesn't double up on hard rive space, why did installing an explicitly py36 environment download everything when I already had python 3.6 installed as root?
For my second laptop, can I just rename root as py36? Or does there have to be a root for some reason?

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.

dhair...@gmail.com

не прочитано,
22 мар. 2018 г., 13:37:2622.03.2018
– conda - Public, rvr...@gmail.com
Faced somewhat same situation. I wanted to copy some packages from root env instead of downloading new version. This solved the problem,..

Conda install package-name --offline

ankit shukla

не прочитано,
20 янв. 2019 г., 14:52:4520.01.2019
– conda - Public, rvr...@gmail.com, msar...@gmail.com
could you tell me how hard linking of done in the packages of anaconda 
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений