installing conda packages (using conda forge) suddenly results in unexpected error (can't activate environment, install packages, etc.) - anaconda

Once I have installed Anaconda, I can activate an environment. I installed pandas, h3-py with conda-forge. Then I tried to do same with geopandas. Solving environment hangs (for entire day). I use Ctrl-C to stop process. Then I cannot install any packages or even activate environments without just getting an unexpected error, and an error report.
I have installed and uninstalled anaconda, I have even done a clean install of Ubuntu (thinking there was something sitting somewhere ruining things), but I still get to the same point (can't activate environments, neither in terminal nor in anaconda GUI).

Related

How can I make anaconda automatically install jupyterlab extensions in every new environment I create?

I would like to have the exact same setup of jupyterlab in every new anaconda environment. Just like I can define some default packages to be installed when creating an environment with
conda config --add create_default_packages package1 package2
I would like to install a few jupyterlab extensions. I can install them by using the command
jupyter labextension install,
but this is a jupyterlab command and not a conda one. Is there a way of creating a script, that would execute only once after creating an environment, or some other mechanism that would let me automate this process?
With JupyterLab 3+.0+ you should not need to install extensions with jupyter labextension install; instead installation with pip install or conda install is now the recommended approach for most users (see documentation).
Extensions installable with pip/conda* do not require Node.js and are therefore more robust and user-friendly; we call them "prebuilt extensions", in contrast to the old "source extensions". We are considering removing support for installing source extensions by end users in a future version of JupyterLab (but not for advanced users and system administrators who should still be able to access this mechanism) as source extensions proved to be causing more trouble than benefit for an average user, and users so far were happy with the transition.
Please also see:
Unable to install jupyterlab-execute-time extension
RuntimeError: JupyterLab failed to build
If extension is not on conda-forge you can always contribute a recipe for it. If that's the case let me know and I can help you with the next steps.
*) or any other package manager which is able to place a .js file in appropriate location - this is not limited to Python ecosystem

How do I fix the error I get when executing pip in Spyder 5.0.3

I am getting an error when trying to run pip through Spyder 5.0.3
I have recently installed Spyder 5.0.3 on my machine from https://www.spyder-ide.org/
When I attempt to exectute "pip --version" on IPython in Spyder I get the following error message:
Note: you may need to restart the kernel to use updated packages.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
How do I fix this so I can run pip in IPython Spyder?
The standalone installer for Windows available in the Spyder website doesn't have pip in it. If you want to use or install a specific package outside of the ones that are shipped with the standalone installer you will need to go with the modular approach to use Spyder (create an environment and select his python executable as the interpreter that Spyder will use).
For that you will need to:
Install a python distribution as for example miniforge: https://github.com/conda-forge/miniforge/tree/4.10.1-3#download
Create a new python environment, install spyder-kernels and the packages you want to use in it.
Set the Spyder interpreter preference to point to the environment created.
The Spyder GitHub wiki has a page that explains the process to setup some of this elements: https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#the-modular-approach

How can I do a fresh installation of Python and Jupyter Lab?

I have been using venv to create virtual environments to work with Jupyter Lab. I tried Anaconda for awhile, but couldn't get the widgets working. I went back to a pip,venv setup and everything worked. Then after not using the setup for awhile, Jupyter Lab was freezing when I pressed CTRL+F to find where a variable was being used. It proceeded to freeze even after restarting the kernel, even after deactivating and reactivating the environment. The folder the environment was in won't let me delete it. Creating a new environment to start from scratch didn't fix it. Reinstalling Python and creating a new environment didn't fix it. I see that Pip has cached a lot of the packages and so installing things are pulled from the cached, event after reinstalling Python.
I want to remove everything related to the previous installation and start fresh, but am having trouble doing that. Any advice would be helpful.
Windows 10
Python 3.8.5 is the most recent version used.
Use pip list to list all package (from the old python the one you want to uninstall). Then copy all the packages and put the in a --requirement file with all the packages installed in it. (how to specify --requirement file) Then use the following command to uninstall all the old packages.
pip uninstall [options] -r <requirements file>

Anaconda continue installation on Linux

I was installing anaconda for my Ubuntu 18.04 machine but I happened to exit the terminal accidentally after a couple of hours. I wish to resume the installation process at that step where it was installing various packages like sklearn, qt, etc.
I get the following error when I run bash Anaconda3-2018.12-Linux-x86_64.sh and give the path where I want my conda home to be (not the default home folder)
ERROR: File or directory already exists: '<path_to_anaconda>/anaconda3'
If you want to update an existing installation, use the -u option.
How do I approach this error? How do I recover from partial installation?
Also conda update --all gives an error conda:command not found

conda not working even though conda is found in site-packages

I encountered a problem with conda while setting up an environment for tensorflow.
I did a whole bunch of conda install and upgrade, updates. After all this, I quite command prompt (Windows 10 OS) and after a few days, return to find that I could not use some conda command such as update, info etc.
I went to look into the site-packages and everything is there so I am puzzled by this strange behavior. I went to uninstall conda and install using pip but that just screwed conda up even more. Now I cannot use conda and I cant get into my environment.
Is there any quick fix or a reinstallation of anaconda is required?
Many thanks in advance!

Resources