Uninstalling conda distribution on Mac - python

I'm trying to uninstall the conda distribution on my Mac using the following standard commands:
conda install anaconda-clean
anaconda-clean -yes
rm -rf ~/anaconda3
rm -rf ~/.anaconda_backup
However, I keep getting the error:
Preparing transaction: done
Verifying transaction: failed
RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
To address the above error I try:
conda update conda
Or:
conda update --force conda
Which in turn returns:
CondaVerificationError: The package for matplotlib-inline located at appears to be corrupted. The path specified in the package manifest cannot be found.
How do I solve this error?

Related

ERROR: No .egg-info directory found in C:\Users\Shreya Gupta\AppData\Local\Temp\pip-pip-egg-info-uoj9me_o

Getting this error while installing librosa:
ERROR: No .egg-info directory found in C:\Users\Shreya Gupta\AppData\Local\Temp\pip-pip-egg-info-uoj9me_o
I have tried the following things:
Upgrading the setup tools: pip install --upgrade setuptools pip
For installing I have tried the following methods:
pip install librosa
Using source:
tar xzf librosa-VERSION.tar.gz
cd librosa-VERSION/
python setup.py install
pip install git+https://github.com/librosa/librosa
Nothing seems to be working. Getting the same error as above mentioned in all the installation methods.
Solution that worked - Using conda "conda install -c conda-forge librosa" to install worked fine.

Conda build package to be compatible with specific python version

I am trying to create a conda package which should be compatible with all python versions greater than or equal to 3.7.
I specified this requirement in my conda.recipe/meta.yaml:
requirements:
host:
- python >=3.7
- pip
run:
- python >=3.7
- importlib-resources >=1.4.0
- ...
For my build command, I first activated a Python 3.7 conda environment, then I specified the build command should use the same environment, and I also specified that the build command should use Python 3.7 just to be safe:
$ CONDA_ENV=/path/to/py3.7/conda/env
$ conda create --yes -p $CONDA_ENV python=3.7 conda-build conda-verify importlib-resources>=1.4.0 # ...remaining reqs
$ conda activate $CONDA_ENV
$ conda build --python=3.7 -p $CONDA_ENV /path/to/package/dir
The build step in conda.recipy/meta.yaml too uses this same environment:
build:
script: bash -c 'source ~/.bashrc && conda activate /path/to/py3.7/conda/env && python -m pip install --no-deps --ignore-installed -vv /path/to/package/dir'
The problem
Running the above commands creates this file:
my-package-1.1.0-py310_0.tar.bz2
I don't get why py310 is in the package name, I did everything I can think of to make it compatible with 3.7 as well.
Here is what happens when I try to create an environment with both python 3.7 and my created package (after uploading the tar.bz2 file to my conda repo):
$ conda create -p ~/temp/conda python=3.7 my-package
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Package python conflicts for:
python=3.7
my-package -> python[version='>=3.10,<3.11.0a0']
my-package -> importlib-resources[version='>=1.4.0'] -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.8,<3.9.0a0|>=3|>=3.6|>=3.7|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|3.4.*|>=3.9,<3.10.0a0|3.10.*']
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__glibc==2.27=0
- feature:|#/linux-64::__glibc==2.27=0
Your installed version is: 2.27
But if I don't specify 3.7 when creating the environment it works fine, but creates an environment with 3.10.
$ conda create -p ~/temp/conda python my-package
Question
How can I make my-package compatible with Python 3.7?
After much unproductive research an unending amounts of trial and error, I found that I should have made my package not specific to any python version by adding noarch: python to my meta.yaml:
build:
noarch: python
script: bash -c 'source ~/.bashrc && conda activate /path/to/py3.7/conda/env && python -m pip install --no-deps --ignore-installed -vv /path/to/package/dir'

How can I install psi4 in a docker container with jupyter environment?

I tried to install psi4 to do a quantum chemistry calculation in the jupyter/minimal-notebook container.
However, as shown in the code block below, I could not install it due to UnsatisfiableError.
(base) jovyan#17285cef33b0:~/work$ conda create -n psi4 python=3.6
Collecting package metadata (current_repodata.json): done
Solving environment: done
....
(ellipsis)
(base) jovyan#17285cef33b0:~/work$ conda activate psi4
(psi4) jovyan#17285cef33b0:~/work$ conda install psi4 -c psi4
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
(psi4) jovyan#17285cef33b0:~/work$
It did not show what was not satisfied.
I don't want to use anaconda because I need to pay for commercial use of anaconda, and I want to use conda-forge as the environment to run psi4. I also want to use docker because I want to have the same conditions to run the program.
Do you have any good ideas to solve this error?
Or is there any environment that can fulfill my wishes?
My environment is Windows 10 and I am using Docker Desktop WSL 2 backend.
The previous answer was deleted because I just pasted the my blog post link. I extract the main steps of how to build from the my blog post and describe it.
I built and installed Psi4 on a docker container by myself. I wrote a post on my blog about how to do that. Please see the following blog post for more details.
https://solkul.hatenablog.com/entry/2021/04/23/002237
Here are the main steps on how to build it.
Basically, you can build it according to this Psi4 documentation.
1. Clone Psi4 repository
Clone the Psi4 repository.
(base) root$ git clone https://github.com/psi4/psi4.git
(base) root$ cd psi4
2. Create new conda environment
Start bash as root. Psi4 only supports until python 3.7, so I should create a conda environment for python 3.7.
(base) root$ conda create -n quantum python=3.7
(base) root$ conda activate quantum
(quantum) root$
3. Install the packages needed to build
Type the following command to install the packages required for the build. Psi4 documentation lists tools and dependencies required for the build.
(quantum) root$ apt-get update
(quantum) root$ apt-get install -y build-essential cmake clang libssl-dev
(quantum) root$ apt-get install -y libopenblas-base libopenblas-dev
(quantum) root$ conda install -y numpy networkx pint pydantic
(quantum) root$ apt-get install -y libmpfr-dev libeigen3-dev
4. Buid and install
It's time to build! Type the following command to Configure and Generate to build.
(quantum) root /psi4$ mkdir build
(quantum) root /psi4$ cd build
(quantum) root /psi4/build$ cmake ..
Let's build!
(quantum) root /psi4/build$ make -j`getconf _NPROCESSORS_ONLN`
This build takes several hours.
After build is complete, type the following command to install it.
(quantum) root /psi4/build$ make install
5. Append lib of install directry to the python import path
In the default configuration, the binaries, includes, libraries, etc. should be installed in /usr/local/psi4. In order to use Psi4 as python module, it is needed to append /usr/local/psi4/lib to the python import path. You should also use Psi4 in the quantum environment, which I just created as the python 3.7 environment. You can do this by appending the directry to sys.path each time as follows.
import sys
sys.path.append("usr/local/psi4/lib")
From now, you can import Psi4.
import psi4

Error installing etetoolkit. When installing using anaconda

I followed the directions to install etetoolkit for mac.
# Install Minconda (you can ignore this step if you already have Anaconda/Miniconda)
curl -L 'http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh' -o Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh -b -p ~/anaconda_ete/
export PATH=~/anaconda_ete/bin:$PATH;
# Install ETE and external tools
conda install -c etetoolkit ete3 ete_toolchain
# Check installation
ete3 build check
I get an error when I run conda install -c etetoolkit ete3 ete_toolchain
Error:
UnsatisfiableError: The following specifications were found to be
incompatible with the existing python installation in your
environment:
ete3 -> python[version='>=2.7,<2.8.0a0,>=3.5,<3.6.0a0,>=3.6,<3.7.0a0']
ete_toolchain -> python[version='>=2.7,<2.8.0a0,>=3.5,<3.6.0a0,>=3.6,<3.7.0a0'
I ran the [package installer][2] for anaconda 3.7. (I don't think I actually had to do this.)
From terminal run: conda install python=2.7
Then conda install -c etetoolkit ete3 ete_toolchain
Then I verified this worked by running ete3 build check. In the results clustalo: MISSING displayed, but that's a new problem to solve.
UPDATE
The final problem was solved by running conda install -c etetoolkit ete3_external_apps
There is a type-o in the instructions given by ete3. Use this instead.

install package from tar.gz in Anaconda

I got *.tar.gz file and how to install that package in conda virtual environment ?
I've tried the following:
$ source activate env01
(env01)$ conda install /installers/anaconda/cassandra-driver-3.11.0.tar.gz
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- cassandra-driver-3.11.0.tar.gz
Current channels:
...
If I use pip install, it wasn't stored in environment directory. See below:
(env01)$ pip install /installers/anaconda/cassandra-driver-3.11.0.tar.gz
Processing /installers/anaconda/cassandra-driver-3.11.0.tar.gz
Requirement already satisfied: six>=1.9 in /dataplatform/software/anaconda/lib/python3.6/site-packages (from cassandra-driver==3.11.0)
Building wheels for collected packages: cassandra-driver
Running setup.py bdist_wheel for cassandra-driver ... done
Stored in directory: /home/linknet/.cache/pip/wheels/e9/ff/17/ebfd2f04dfac5206db48c1520c6f669ec225ddc2c192aada17
Successfully built cassandra-driver
Installing collected packages: cassandra-driver
Successfully installed cassandra-driver-3.11.0
My conda env01 directory is: /dataplatform/software/anaconda/envs/env01
I managed it by cloning conda env from base and install the package.
$ conda create -n env01 --clone base
Source: /dataplatform/software/anaconda
Destination: /dataplatform/software/anaconda/envs/env01
The following packages cannot be cloned out of the root environment:
- conda-4.4.10-py36_0
- conda-build-3.4.1-py36_0
- conda-env-2.6.0-h36134e3_1
Packages: 238
Files: 1
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(env01)$ conda install /installers/anaconda/cassandra-driver-3.11.0py36_1.tar.bz2
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Now I'm able to install the package without connecting to the internet.

Categories