0

Fairly new to python here, I need a couple of TensorFlow environments for anaconda (one is tf, while the other is an older version).

How do people usually do stuff like this?

Edit: got by one obstacle. Was having problems removing environments. Found way to fix this. Was getting:

    PackagesNotFoundError: The following packages are missing from the target environment:

  -

Now going to try @B200011011 suggestion: conda create -n myenv python=3.7 ... got 3.8.1

but I can not install tensorflow:

...>pip install tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

End of Edit.

Edit 2:

this worked today:

(base) D:\ray\dev\ml\DC to Edge Course>conda update conda
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

End of Edit 2.

Below is what I have tried.

I have:

(base) ...>conda env list

  conda environments:

base                     D:\Anaconda3
                      *  d:\Anaconda3

Why do I have two?

Trying: conda update --all gets:

The following packages will be DOWNGRADED:

  anaconda                                   2019.10-py37_0 --> custom-py37_1
  pycosat                              0.6.3-py37hfa6e2cd_0 --> 0.6.3-py37he774522_0

Same thing happens when i do a: conda update anaconda

Should i proceed?

When i try to update python, i get:

Updating python is constricted by

anaconda -> requires python==3.7.4=h5263a28_0

If you are sure you want an update of your package either try `conda update --all` or install a specific version of the package you want using `conda install <pkg>=<version>`

done

# All requested packages already installed.

Should I proceed?

When I create a new environment, it has no python in it.

if i try to clone the base, I get:

The following packages cannot be cloned out of the root environment:
 - defaults/win-64::conda-4.8.1-py37_0
 - defaults/win-64::conda-build-3.18.9-py37_3
 - defaults/win-64::conda-env-2.6.0-1

What did this do? Will it have any effect on tensoflow?

Cadoiz
  • 1,446
  • 21
  • 31
Ray Tayek
  • 9,841
  • 8
  • 50
  • 90
  • I'd suggest using pyenv and pyenv-virtualenv for managing different python environments – OneCricketeer Jan 15 '20 at 04:41
  • A good starting point is using conda like described here: https://docs.anaconda.com/anaconda/user-guide/tasks/tensorflow/ For using (ana)conda in a popular IDE like e.g. PyCharm, this page can be accessed: https://www.jetbrains.com/help/pycharm/conda-support-creating-conda-virtual-environment.html I am convinced, that an analogous support page exists for other major IDEs too. – Cadoiz Jul 25 '20 at 23:26
  • In which way did you install your python version(s) and anaconda? Because both user and system mode are present on Windows, which can interfere. To find that out, you can type these commands into the cmd: `where anaconda` and `where python`. This should output a list of found places in your installation. If something is missing, you can also check `PATH` to see weather it is added there. – Cadoiz Jul 25 '20 at 23:37

2 Answers2

1

I faced similar problem of no python in conda environment. This link contains necessary information to create and manage conda environment, https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

The command, conda create -n myenv python=3.7 will create a new environment named myenv with python 3.7. It can be similarly deleted by using command, conda remove --name myenv --all.

conda env list command will show list of created environments including base. conda activate myenv will activate the environment and now here in terminal tensorflow can be installed with pip using, pip install --upgrade tensorflow.

Instructions for setting up tensorflow with conda environment also available here, https://www.tensorflow.org/install/pip

GPU instructions here, https://www.tensorflow.org/install/gpu

In pycharm selecting python interpreter from an existing conda environment will make all its package available.

B200011011
  • 3,798
  • 22
  • 33
  • This is useful information, also the python version setting part, which is a common source for these errors. More Info on conda and environment usage can be found here: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands – Cadoiz Jul 25 '20 at 23:32
1

With your error,

enter image description here

We prefer to use conda install <package> instead of pip install <package>

turong
  • 1,474
  • 9
  • 14
  • trying those now, but it's a nightmare: https://stackoverflow.com/questions/62376660/installing-tensorflow-2-gets-a-dll-failed-to-load-in-pywrap-tensorflow-py – Ray Tayek Jun 25 '20 at 09:38