Not able to create condo environment in SageMaker studio - python-3.x

Sagemaker studio terminal shows default python version as "Python 3.7.10"
I am trying to create conda environment with python3.9 version as below.
conda create --name custom_python_39 python=3.9
But I get the following error:
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.
But pip list doesn't show setuptools.
I already tried the following
conda update conda -n base
conda update --force conda
But I get the following erros:
bash-4.2$ conda update conda -n base
Collecting package metadata: done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- conda-forge/noarch::pyopenssl==22.0.0=pyhd8ed1ab_0
- conda-forge/noarch::requests==2.27.1=pyhd8ed1ab_0
- conda-forge/noarch::urllib3==1.26.9=pyhd8ed1ab_0
- conda-forge/noarch::argon2-cffi==21.3.0=pyhd8ed1ab_0
- defaults/linux-64::argon2-cffi-bindings==21.2.0=py37h7f8727e_0
- conda-forge/noarch::bleach==3.1.4=pyh9f0ad1d_0
- conda-forge/linux-64::brotlipy==0.7.0=py37h5e8e339_1001
- conda-forge/linux-64::conda==4.6.14=py37_0
- conda-forge/linux-64::ipykernel==5.2.0=py37h43977f1_1
- conda-forge/linux-64::ipython==7.13.0=py37hc8dfbb8_2
- conda-forge/linux-64::jedi==0.16.0=py37hc8dfbb8_1
- conda-forge/noarch::jinja2==2.11.3=pyhd8ed1ab_1
- conda-forge/noarch::jsonschema==3.2.0=pyhd8ed1ab_3
- conda-forge/noarch::nbconvert==5.6.1=pyhd8ed1ab_2
- conda-forge/noarch::notebook==6.4.1=pyha770c72_0
- conda-forge/noarch::prompt-toolkit==3.0.5=py_1
- conda-forge/noarch::pygments==2.6.1=py_0
/ Killed

Related

Unable to install tensorflow-gpu on anaconda with PackagesNotFoundError

I have created new environment in anaconda, webapp-env, to use streamlit and flask.
I have installed cuda (8.1) and cudatoolkit (11.2) so it is compatible with my environment and am trying to install tensorflow-gpu=2.8.0 (or 2.9.0) as per the table here:
https://www.tensorflow.org/install/source_windows
Unfortunately, I am getting this error (below) and I dont know how to solve this.
(webapp-env) PS C:\Users\me\Coursera_NN_visualizer_web_app_MNIST_project> conda config --append channels conda-forge tensorflow-gpu = 2.9.0
usage: conda-script.py [-h] [-V] command ...
conda-script.py: error: unrecognized arguments: tensorflow-gpu = 2.9.0
(webapp-env) PS C:\Users\me\Coursera_NN_visualizer_web_app_MNIST_project> conda install -c conda-forge tensorflow-gpu=2.8.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- tensorflow-gpu=2.8.0
Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
I have an Nvidia 3060 graphics card and can use tensorflow-gpu version 2.8.0 successfully in my anaconda base virtual environment.
any advice?
Tnesorflow-GPU in the mainchannel is at version 2.6 and from conda-forge, only a linux version is available, see here and here
You probably used pip to install it in your base env. You can do so in your new env just as well

why could not found eyed3 in the conda repo

When I tried to install eyed3 using conda command like this:
sudo conda install eyeD3
show this error:
$ sudo conda install eyeD3 ‹ruby-2.7.2›
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- eyed3
Current channels:
- https://conda.anaconda.org/conda-forge/osx-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
why could not found the eyed3 in the conda repo? what should I do to install eyed3 using conda?
There is no conda package for macOS in any conda channel, so you will neeed to follow the docs and do
pip install eyeD3

How to install Keras tuner for anaconda?

I've tried these commands inside the conda environment that I've created.
sudo pip install -U keras-tuner
sudo pip3 install -U keras-tuner
and
git clone https://github.com/keras-team/keras-tuner.git
cd keras-tuner
pip install .
Still my jupyter notebook shows an error stating:
No module named kerastuner
I just installed it with: conda install -n env_name -c conda-forge keras-tuner
To install this package with conda run one of the following:
conda install -c conda-forge keras-tuner
conda install -c conda-forge/label/cf202003 keras-tuner
source: https://anaconda.org/conda-forge/keras-tuner
If you find yourself in need of a PyPI package in Conda then you should write a YAML file and create a new environment using that. This is the best practice recommendation found in "Using Pip in a Conda Environment". Otherwise, Conda can get rather unstable if you install PyPI packages ad hoc. It would be something like:
environment.yml
name: my_keras_env
channels:
- conda-forge
- defaults
dependencies:
- python=3.7 # change this to meet your needs
- ipykernel # since you're using Jupyter
- keras
- tensorflow>=2.0.0 # this and below are keras-tuner requirements
- numpy
- tabulate
- terminaltables
- colorama
- tqdm
- requests
- psutil
- scipy
- scikit-learn
- ... # add any additional packages you require
- pip
- pip:
- keras-tuner
Note the keras-tuner requirements are found in the setup.py file.
Then, to create the environment
conda env create -f environment.yml
Note that you can use the --name|-n flag to provide a different name for the env.
Whenever you need to add additional packages to the env, edit the YAML definition and recreate the env.

Problem when installing pybox2d with anaconda

I tried to install pybox2d through anaconda navigator with Python 3.7 , but it shows this error, I could not solve
I read all the library documentation!
Error:
(user) user#euser:~$ conda install -c https://conda.anaconda.org/kne pybox2d
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- jeepney
- notebook==5.7.4
- pybox2d
Use "conda info " to see the dependencies for each package.
I had the same problem. My tensorflow and pybox2d where conflicting.
I followed these steps by anuj:
conda create -n stackoverflow_env python=3.7
source activate stackoverflow_env
conda install -c kne pybox2d
and then installed tensorflow from anaconda navigator in this environment.
I created a new conda environment to avoid being influenced by the existing installations and followed the steps given below. After this, Box2D is importing fine for me.
conda create -n stackoverflow_env python=3.7
source activate stackoverflow_env
conda install -c kne pybox2d

Conda with Cygwin: Environment created but location not found and unusable after activation

On Windows 10 I have Miniconda3 installed under C:/home/miniconda3
I'm using Cygwin (bash shell emulator) and within the Cygwin shell (at the command line) I'm trying to create a virtual environment using conda.
I am creating an environment using conda and it appears to be created OK, however when I activate and then try to use the environment I get an error that appears to show that there's something amiss with the environment that's been created. Here's what I've tried so far:
Start with a fresh Miniconda installation (downloaded and installed today), and list the environments:
$ conda env list
# conda environments:
#
base * C:\home\miniconda3
Create an environment:
$ conda create -n test_env
Solving environment: ...working... done
## Package Plan ##
environment location: C:\home\miniconda3\envs\test_env
Proceed ([y]/n)?
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use:
# > activate test_env
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#
Display the environments again, showing that the environment was created:
$ conda env list
# conda environments:
#
base * C:\home\miniconda3
test_env C:\home\miniconda3\envs\test_env
Activate the new environment, using source (since Cygwin is running bash). Now when I list the environments I expect to see an asterisk next to the test environment's name, indicating that it's now the active environment, but that's missing:
$ source activate test_env
$ conda env list
# conda environments:
#
base C:\home\miniconda3
test_env C:\home\miniconda3\envs\test_env
At this point I can try using conda commands and they'll all fail since the environment's not being found and/or the environment itself is incomplete/malformed/corrupted:
$ conda list
EnvironmentLocationNotFound: Not a conda environment: C:\home\miniconda3\envs\test_env
$ conda install pandas
EnvironmentLocationNotFound: Not a conda environment: C:\home\miniconda3\envs\test_env
$ conda update pandas
PackageNotInstalledError: Package is not installed in prefix.
prefix: C:\home\miniconda3\envs\test_env
package name: pandas
When I try to deactivate the environment I get the following errors:
$ source deactivate
': not a valid identifierULT_ENV
': not a valid identifier
': not a valid identifierIX
': not a valid identifierPT_MODIFIER
': not a valid identifierON_EXE
Thanks in advance for any suggestions as to what may be going wrong and/or how I can fix this.
Running conda under Cygwin is not fully supported, and the recommended solution for users who want to run conda and associated conda environments in a Linux like shell on Windows is to use the bash shell that comes included with the git client for Windows

Resources