Conda env corrupted - anaconda

Checked the conda environment using the below command:
> conda info
ERROR: The install method you used for conda--probably either `pip install conda`
or `easy_install conda`--is not compatible with using conda as an application.
If your intention is to install conda as a standalone application, currently
supported install methods include the Anaconda installer and the miniconda
installer. You can download the miniconda installer from
https://conda.io/miniconda.html.

If you had a working version of a conda environment before this error started to occur, you can revert back to that working environment using this command:
conda list --revision
and
conda install --revision [n]
Otherwise, you can try to [re]install conda from the miniconda install web page:

Related

WSL2 using pip with anaconda environment to install packages

I am on a Windows machine running WSL2 with Ubuntu 22.04 (fresh install) afterwards I installed Anaconda with wget https://repo.anaconda.com/archive/Anaconda3-5.1.0-Linux-x86_64.sh and bash Anaconda3-5.1.0-Linux-x86_64.sh. I also update my conda by running conda update conda
However when I create a new conda enviroment (conda create --name=test-env python=3.8) and activate my test-env environment to install pip (conda install pip), so I can install packages with pip, all package I install with pip are installed into the base anaconda environment.
f which -a pip returns /home/user/anaconda3/bin/pip I've tried adding /home/user/anaconda3/envs/test-env/lib/python3.8/site-packages to my $PATH variable by executing export PATH=/home/user/anaconda3/envs/test-env/lib/python3.8/site-packages:$PATH and executing source ~/.bashrc but this doesn't even change anything to the result of which -a pip (pip installed in my environment is not added), so it still installs my pip packages inside base instead of my environment.
How do I get ubuntu wsl2 to run the correct pip package manager when I activate my environment? Some goes for python, if I run python when my environment is active it references python that is installed in base and not my active environment

Cannot install python wheel file in conda without sudo

I'm trying to build PyTorch from a .whl file on a jetson nano.
I am able to build and install the file but only while using sudo, attempting to pip install the file without sudo results in this error:
ERROR: torch-1.10.0a0+git36449ea-cp36-cp36m-linux_aarch64.whl is not a supported wheel on this platform.
This is strange as with admin I have no issues installing this file, but I can then only use the library by using the sudo command before going into or running with the python command.
I should note that this is in a conda environment, but even in the base conda environment this issue still occurs.
It seems like I can also install the package by using conda deactivate to deactivate conda.
I am using Python 3.7 in the conda environment and Python 3.6 outside.
I am using Python 3.7 in the conda environment and Python 3.6 outside.
This is the issue. You have a cp36 whl file, so python 3.6. I am suspecting that when you run sudo pip, your systems pip is invoked, whereas when you run pip, then pip from your conda env is used, and cannot install a python 3.6 whl to a python 3.7 env.
Either you need to get the cp37 whl or create a conda env that has python 3.6 installed

How to install tensorflow-transform on anaconda?

We can install tensorflow-transform using pip but how do I install it using Conda?
I have tried using conda install -c anaconda tensorflow-transform and all its variants without result.
A search of Anaconda Cloud shows that tensorflow-transform is not available through any channels on any platform. Moreover, the recommended way to install the package is to use PyPI. However, one can still install the package into a specific Conda env by first activating the env:
conda activate your_env
pip install tensorflow-transform

Installing packages in conda environments fails when conda attempts to uninstall a root package

I've installed Anaconda on linux, it's installed in user space under my home folder.
I've created an environment.
Within that environment I've run conda install anaconda to install all standard packages.
I'm trying to install tensorflow now, running:
pip install --upgrade tensorflow-gpu
This process attempts to upgrade the numpy package. But that step errors out because it's trying to uninstall the system numpy package in /usr/local/bin/f2py.
I thought this environment was all self-contained in user space. Any idea why it would attempt to uninstall a system package that was installed before Anaconda was installed?
You probably need to clear your PYTHONPATH environment variable, if its pointing at the system installation of Python.

Dependency issue with conda, pip and virtualenv

I am using conda(anaconda 2). Before installing anaconda, my Ubuntu16.04 already had pip installed. I recently installed virtualenv using pip install virtualenv. I did the following steps while trying to install coala in my virtual environment.
Create a new virtual environment using virtualenv venv
Activate environment using source activate path/to/activate
Clone the coala repository.
Run pip3 install -e . while inside the repository
After all this, I get the following error from coala:
There is a conflict in the version of a dependency you have installed and the requirements of coala. This may be resolved by creating a separate virtual environment for coala or running `pip install "yapf~=0.14.0"`. Be aware that the latter solution might break other python packages that depend on the currently installed version.
I am already in a virtualenv, so I tried installing yapf as per the command: pip install "yapf~=0.14.0". After that, when I check my pip list, it still showed yapf (0.15.2), To solve this, I did:
pip uninstall yapf
pip install "yapf~=0.14.0"
Now when I check my pip list, I get the desired results. BUT, the error is still there. It still shows the same dependency error. I am unable to understand what is happening? Which pip is installing what and where, what is conda doing behind the scenes, how is virtualenv behaving with conda, and the most important, why this error and how to resolve it?
first create a virtualenv pertaining to python3.x
template
virtualenv -p {location of python3 version } {name of virtualenv folder}
like this
virtualenv -p /usr/local/bin/python3 venv
then activate it
source venv/bin/activate
then run
pip install {library you want to use}
pip install "yapf~=0.14.0"
This should install yapf into the venv folder.
try that let us know.
Answering my own question, what I found out was that conda and virtualenv do not go hand in hand. condas has the ability to create it's own virtual environment, and if using condas, we must create a conda virtual environment(See this answer).
What I did was uninstalled conda and make a virtual environment using virtualenv. What I could have done as well is uninstall virtualenv and create condas environment and work in that.

Resources