Pip installed packages don't show up in Anaconda Navigator - python

Many Python packages don't have pre-built conda packages, so Anaconda users are frequently forced to use pip to install packages. I have to do this routinely, since so many packages don't have conda packages, not even in the most common alternate channel(s) like conda-forge or bio-conda.
This open issue was already reported in the Anaconda github support repo https://github.com/ContinuumIO/anaconda-issues/issues/10634. However, no answers have been forthcoming in almost 1 year. I am asking here because responses are typically faster and shared more widely than in support forums for individual products.
I hate the productivity loss of re-installing Anaconda, particularly a long-standing installation, because it can take 3-4 hours to backup and export existing environment build files as requirements.txt, remove an existing Anaconda installation, clean out the Windows Registry, search the Windows file system for leftover detritus, and then rebuild all of my environments one at a time.
Does anyone know a trick, or have a Python script or some other workaround(s) to refresh the Package Index within a conda environment or for ALL environments created and managed by the Anaconda Navigator GUI. It would be awesome if there was an updater widget within the Anaconda Navigator GUI to allow users to select for which virtual environment(s) they want the package index to be updated.
What I have tried
In the Anaconda Navigator GUI "Environments" tab, clicking on the "Update Index..." button does not get updated with the list of packages installed "behind the scenes" from a Anaconda Command Prompt.
The result I get
pip-installed packages are NOT included in the Anaconda Package Index update process. It does not find packages in environments installed inside and outside of the Anaconda3 root directory. It doesn't even find all packages underneath the \envs folder. This makes me think packages are not installed into the currently selected environments, so it takes time to verify their location in C:\ProgramData\Anaconda3\envs, C:\Users\username\AppData\Local, or elsewhere.
What else I have tried: after having a corrupted Anaconda and Spyder installation that would not start at all, I posted requests for help on various support forums. I got answers that were not much help, like "Just don't mix pip and conda packages, use one or the other". That is not practical since so many Python packages are not available in the conda package format. I have gotten that impractical advice from Anaconda and Spyder developers in the past.
Severity and impact
This is an important issue, since it is possible to use / misuse conda and pip and inadvertently corrupt Anaconda so badly that it requires a painful and time-consuming removal and re-installation of the entire Anaconda distribution.
A possible solution beyond my current cable-tow... If someone can build an intelligent and transparent converter built into the PyPi, Anaconda Cloud, Conda-forge, and other channels that made this conversion automatic and validated, then this conversation might not be needed.

Related

Anaconda3 infinite solving environment problem

I have downloaded the anaconda3 a complete newer version from official site.. I tried to create an environment but the 'solving environment' keeps on running..
I tried turning off windows defender but it didn't work.. someone plz help.. I am using windows 11 pro, and I have downloaded and installed Anaconda3-2022.10-Windows-x86_64 on 23/12/2022
The actively available Anaconda builds for Python 3.6 all use 3.6.10, so you would have a possibly easier solve with:
conda create -n ssd_env python=3.6 anaconda
However, there is the custom build, anaconda=custom=py36_1 that should be generally compatible with python>=3.6,<3.7. That is what I get when simulating the solve from OP:
CONDA_SUBDIR=win-64 mamba create -n ssd_env --override-channels -c anaconda python=3.6.8 anaconda
which solves almost instantly with Mamba.
Using conda also takes unreasonably long for me, even when explicitly identifying the anaconda=custom=py36_1. The reason this takes so long is that this anaconda package has no version constraints on the 100+ packages it specifies, which means a huge search space. This is aggravated by the fact that the solvers work from latest to oldest package versions, and the versions that are expected to be identified are ~3 years down the stack.
I recommend:
Use Mamba as the solver.
Don't use the anaconda package unless absolutely needed. Most users do not ever need all those packages - instead just specify the packages actually required.

Should I reinstall all Python libraries if I install Anaconda's Python as primary in my system?

I have been using Python on Windows for some time to analyze survey data, usually available in the form of Excel files. For this reason I have installed several libraries, including pywin32, holoview, bokeh, pandas, numpy and so on.
Now I have found that there is a Python distribution called Anaconda which is a prerequisite for some artificial intelligence libraries that I would like to use.
I downloaded it, but when I install it, it recommends me to register the Python included in Anaconda as primary. This would mean that it would be seen as such by all the tools I use, such as PyCharm.
If I understand correctly, it is possible to have several Python installations on a PC, but what happens to the libraries? I mean, if I make Anaconda's Python primary, do I have to reinstall all the libraries I used before to run the programs I have already written?
I can't find an answer in the Anaconda FAQ, so before proceeding with the installation, I would need to better understand what conflicts I might possibly create on my system.
Here are the some answers from my side.
1. Will the libraries & files conflit?
No. - Both local & Anaconda will have separete site packages folders to store installed libraries.No matter how many different versions of python you install there will be separate site-packages folders named with respective versions to store installed libraries.
2. Should I need to re-install packages again that I'm alredy using in older python before I run a program on anaconda?
Yes. Local python will use - cmd -WIndows command prompot
Anoconda will use - Anaconda prompt - Which will be installed along with installation. Both Anconda and local python maintains separate storage locations in order to store & process data which includes libraries, settings, Environments, cache....
3.if we selects Anaconda as primary. This would mean that it would be seen as such by all the tools I use, such as PyCharm?
No. Pycharm will have old configuartion whatever you using currently
even thouh we install anaconda & make its a primary. But, still you
can use anaconda from pycharm by creating a virtual environmnet for it.

Spyder standalone environment

I intend to install Spyder standalone on a Mac. (In addition I will use conda to manage my environments, and point Spyder to the environment I want to use.)
Now, suppose I want to manage things in the environment where Spyder itself is installed (the standalone installation), for example install packages there. How do I do it? In a conda environment I could do something like this:
conda activate myenv
and work there. But since Spyder is a standalone environment, how do I access it?
In addition, since this standalone installation goes into "applications" in the mac, will it notify me when a new version of Spyder is available and offer to update (as in other applications?
EDIT:
I found some contradicting-looking information about this. According to this I should probably not install packages there (and maybe it's impossible).
but here
in the first bullet point at the bottom of the page, it says "In order for the Variable Explorer to be able to display the built-in editors for specific data types (Numpy array, Pandas Series/DataFrame, etc) the corresponding optional Spyder dependencies (Numpy, Pandas, etc) need to be installed in Spyder's environment".
(Spyder maintainer here) About your questions:
Now, suppose I want to manage things in the environment where Spyder itself is installed (the standalone installation), for example install packages there. How do I do it?
It's not possible to install any package in our standalone installers. That's by design in order for users to not break them.
If you need to use other packages that don't come with them (e.g. Scikit-learn or Seaborn), you need to create a new environment, install them there and connect Spyder to that environment. That process is better described in these instructions.
since this standalone installation goes into "applications" in the mac, will it notify me when a new version of Spyder is available and offer to update (as in other applications?
We don't offer that functionality yet, but we'll try to do it in the future.
but here in the first bullet point at the bottom of the page, it says "In order for the Variable Explorer to be able to display the built-in editors for specific data types (Numpy array, Pandas Series/DataFrame, etc) the corresponding optional Spyder dependencies (Numpy, Pandas, etc) need to be installed in Spyder's environment".
All optional dependencies needed to explore Numpy arrays and Pandas dataframes are provided in the installers.

question about virtual environments from conda to virtualenv

I have been working on a project in python that its inside an environment created at a linux machine. I recently got a new pc and i tried freebsd so i decided to see if i can port the settings, since these environments are supposed to be platform independent.
Since there is no support for conda in freebsd, i decided to write a script to migrate the dependencies from conda to virtualenv. The script, although it translates the .yml file into the .txt file needed for pip to install the dependencies, i can see that there are still a lot of packages missing, especially from the dependencies label in the .yml file.
Does it mean that these packages are not yet ported on freebsd or is there a different way to add them in the .txt file instead of just their name?
Does it mean that these packages are not yet ported on freebsd or is there a different way to add them in the .txt file instead of just their name?
It sounds like pip can't find a number of your dependencies, so yes.
Keep in mind that conda and pip are completely different build systems, despite being mostly compatible with each other and despite most packages available on one being available on the other. This also means that conda list usually includes some packages you don't necessarily need to install via pip. So you may be better off starting from scratch with a new requirements.txt file that includes the packages you actually need, and just let pip find what else it needs (which, again, is likely different than what conda needs).

Install all Anaconda packages in air-gap computer

I have computer that is not connected to the internet.
I download Anaconda installation wizard , but it is not contains all the packages that Anaconda contains in their website , and this uncomfortable .
How I can download all the packages that display in Anaconda for offline installation (the size of the installation is not a problem).
According to the Anaconda page here: Obtain a copy of the system appropriate installer, copy to the air-gapped machine, then follow the detailed instructions for you operating system (see links under "Detailed installation information".
Check the environment tab and see if the package you want is part of the environment, but not installed - many are already there. If it is part of the environment, then use the interactive installer to get it installed.
You can also try (from the command line/console) conda install <package-file-name>.tar.bz2 if you have a particular downloaded package that you want to install. Obviously in this case it needs to be a tar.bz file, but you should be able to modify that for other compression types.
Other environments, such as R are also available in the downloaded, but not installed category.
I think (not sure on this) that things such as Rstudio need to be downloaded separately to install.

Categories