Use conda in linux - python

I install anaconda in my ubuntu , but I don't use Conda.
I have this error and I don't fix this.
mamal#DESKTOP-H4B5SN5:~$ conda create -n pars
conda: command not found
mamal#DESKTOP-H4B5SN5:~$ /boot/anaconda3/bin/conda create -n pars
Collecting package metadata (current_repodata.json): done
Solving environment: done
UnavailableInvalidChannel: The channel is not accessible or is invalid.
channel name: pkgs/main
channel url: https://repo.anaconda.com/pkgs/main
error code: 403
You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.

Related

How to integrate a newer release of python (2.7.18) into Anaconda Version 2019.10 with Python 2.7 (2.7.16)?

It seems that Anaconda 2019.10 is the latest Version with python2 integrated in it.
This distribution has "python 2.7.16" integrated.
How can I integrate a newer release of python (2.7.18) into Anaconda Version 2019.10?
I have the installation for "python 2.7.18" (python-2.7.18.amd64.msi, around 20MB).
If I install this one also, what parts of the installed files would I have to copy to the Anaconda Destination path?
Well, it has been quite a while for this one, but better late than never ...
Someone from the administration team in the company has implemented a package server as a usable mirrored repository.
They are doing extensible security checks on new packages before sharing it on this package repository.
So, with a little "batch routine" for implementing this new environment our users are now able to implement new packages on their client machines, without even having administrative rights on their machines. :-)
For those of you who are interested in this little "batch routine", here it comes:
For configuration you first start an "Anaconda Prompt" and enter the following commands one after the other:
conda config --set ssl_verify false
conda config --set report_errors false
conda config --set channel_alias https://someserver.domainname.corp/repository
conda config --append channels py-anaconda/
conda config --append channels py-snapshots/
conda config --append channels py-releases/
conda config --append channels py-conda-forge/
conda config --append channels py-continuum/pkgs/main/
conda config --append channels py-continuum/pkgs/free/
conda config --append channels py-continuum/pkgs/r/
conda config --append channels py-continuum/pkgs/pro/
conda config --append channels py-continuum/pkgs/mro/
conda config --append channels py-continuum/pkgs/msys2/
conda config --append channels py-continuum/pkgs/mro-archive/
conda config --append channels py-continuum/pkgs/archive/
conda config --remove channels defaults
conda config --append repodata_fns repodata.json
conda config --append repodata_fns current_repodata.json
Of course you have to replace the "someserver.domainname.corp" with your own servername on your company ...
Since you do not have write permissions in the standard Anaconda environment, you must now create a new environment and activate it. To do this, enter the following commands ("name" stands for the name of the new environment):
conda create -n name
conda activate name
Now you can install new packages in this new environment using "conda install package name".
That's it - have fun :-)

How to remove anacnda environments that's not in default env directories?

I created an conda environment in the path of my choice rather than anaconda's default directory with:
~$ conda create --prefix=/data/sfy_envs/test python=3.8
After successed, the environments are visible in conda:
~$ conda info --envs
# conda environments:
#
base * /data/miniconda3
maskrcnn_sfy /data/miniconda3/envs/maskrcnn_sfy
torch16-sfy /data/miniconda3/envs/torch16-sfy
/data/sfy_envs/test
/data/sfy_envs/tf2-sfy
The last two environments are created with --prefix parameters, and have no name. I can activate them by directly refer to their path:
~$ conda activate /data/sfy_envs/test
But I cannot remove them. For example to remove test, I tried:
~$ conda remove /data/sfy_envs/test
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are missing from the target environment:
- /data/sfy_envs/test
and
~$ conda remove -p /data/sfy_envs/test
CondaValueError: no package names supplied,
try "conda remove -h" for more details
These won't work and I have on idea why.
Or could I just delete the environment directory manually, and remove their paths from the file .conda/environments.txt? I'm not sure if it's a safe treatment.
Use
conda env remove --prefix /data/sfy_envs/test
or
conda remove --prefix /data/sfy_envs/test --all

Install conda package manually Databricks ML runtime

I have a Databricks ML Runtime cluster. I am trying to install fbprophet library using cluster init_script. I am following the example in the Databricks documentation.
#!/bin/bash
set -x
. /databricks/conda/etc/profile.d/conda.sh
conda info --envs
conda activate /databricks/python
conda install -y --offline /dbfs/conda_packages/linux-64/fbprophet.tar.bz2
But the init_script logs show that it cannot activate conda env, and cannot locate package from given path.
: invalid option
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
bash: line 2: /databricks/conda/etc/profile.d/conda.sh
: No such file or directory
usage: conda [-h] [-V] command ...
conda: error: unrecognized arguments: --envs
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
PackagesNotFoundError: The following packages are not available from current channels:
- /dbfs/conda_packages/linux-64/fbprophet.tar.bz2
Current channels:
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/linux-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/linux-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.
Can you please guide me what is wrong with the script, and how can I install the conda package from a path on DBFS.
Or is there any other way I can install conda packages. Because if I try to install using UI, or library API, it fails to install fbprophet package.
Regards

pycafe installation on conda fails in MacBook Air Catalina

I use MacBook Air, with catalina OS. The conda version I use is 4.9.2.
I am trying to install pycafe with conda using the following syntax in my homebrew window:
conda install -c paulscherrerinstitute pycafe
And I get the following error:
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:
- pycafe
Current channels:
- https://conda.anaconda.org/paulscherrerinstitute/osx-64
- https://conda.anaconda.org/paulscherrerinstitute/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
- https://conda.anaconda.org/conda-forge/osx-64
- https://conda.anaconda.org/conda-forge/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.
Can you please help on how to install pycafe?
Package Unavailable for OS X
As mentioned in the comments, this particular package is only available through a user channel and they had only built it for the linux-64 platform and Python 3.5. If you're keen on avoiding having to compile this yourself (and I should note that the version build is still the latest), then I'd suggest going through Docker to build and host the environment.
Alternative: Docker Container
I put together a basic Dockerfile and YAML as a starter, but I'd expect there may be some additional configuration (e.g., setting environmental variables) that is needed.
pycafe.yaml
name: pycafe
channels:
- paulscherrerinstitute
- conda-forge
- defaults
dependencies:
- python=3.5
- pycafe
- cafe
- numpy
Dockerfile
ROM continuumio/miniconda3
SHELL ["/bin/bash", "--login", "-c"]
# Install PyCafe
COPY pycafe.yaml .
RUN conda env create -f pycafe.yaml -n pycafe \
&& conda config --set auto_activate_base false \
&& sed -i "s/conda activate base/conda activate pycafe/" ~/.bashrc \
&& conda clean -a -y
Placing both of these in a directory, one can build the Docker image with
docker build -t "pycafe:1.3.0" .
Then one could launch a Python session with
docker run -it pycafe:1.3.0 bash
python

How to install django in windows 10

I'm using anaconda interpreter, can you please tell me how to install django by creating conda environment in different drive (other than C drive).
Thank you
You could use the -p or --prefix argument in conda create to save the environment to a specific location.
conda create -p D:/path/to/my/env django
The only difference here is that the environment will not be in the list provided by anaconda and thus has to be explicitly activated with its path.
For example this is what it looks like on OS X:
conda create -p ~/Desktop/test -y -q django
Package plan for installation in environment /Users/grr/Desktop/test:
The following NEW packages will be INSTALLED:
ca-certificates: 2017.08.26-ha1e5d58_0
certifi: 2018.1.18-py36_0
django: 1.11.8-py36hd476221_0
libcxx: 4.0.1-h579ed51_0
libcxxabi: 4.0.1-hebd6815_0
libedit: 3.1-hb4e282d_0
libffi: 3.2.1-h475c297_4
ncurses: 6.0-hd04f020_2
openssl: 1.0.2n-hdbc3d79_0
pip: 9.0.1-py36h1555ced_4
python: 3.6.4-hc167b69_1
pytz: 2017.3-py36hf0bf824_0
readline: 7.0-hc1231fa_4
setuptools: 38.4.0-py36_0
sqlite: 3.21.0-h3efe00b_0
tk: 8.6.7-h35a86e2_3
wheel: 0.30.0-py36h5eb2c71_1
xz: 5.2.3-h0278029_2
zlib: 1.2.11-hf3cbc9b_2
# conda environments:
#
Tensorflow /Users/grr/anaconda/envs/Tensorflow
cbc /Users/grr/anaconda/envs/cbc
py27 /Users/grr/anaconda/envs/py27
py35 /Users/grr/anaconda/envs/py35
root * /Users/grr/anaconda
source activate ~/Desktop/test
(/Users/grr/Desktop/test) Diouf: grr ~ $
On Windows you would just omit source during activation.

Categories

Resources