Warning: 2 possible package resolutions only showing differing packages anaconda - python

Well a similar question has been asked already: resolving package resolutions in conda
Solving environment: /
Warning: 2 possible package resolutions (only showing differing packages):
- defaults/noarch::path.py-12.0.2-py_0, defaults/osx-64::path-13.2.0-py37_0
- defaults/noarch::path.py-12.4.0-0, defaults/osx-64::path-13.1.0-py37done
Already tried the following:
conda update --strict-channel-priority --all
conda update --all
conda update anaconda
conda update conda
Nothing seems to resolve this! Will really appreciate any help.
Conda info ==> http://dpaste.com/2951Y1J
conda version: 4.8.3
conda build version: 3.18.11
OS: Mac OS 10.14 Mojave
TIA

Hi recently I had the same problem, I'm just a newbie, but I found a way to solve it.
For example:
Warning: 2 possible package resolutions (only showing differing packages):
defaults/noarch::sphinx-3.5.3-pyhd3eb1b0_0, defaults/win-64::docutils-0.17-py38haa95532_1
defaults/noarch::sphinx-3.5.4-pyhd3eb1b0_0, defaults/win-64::docutils-0.16-py38done
The solution is: conda update sphinx, and then conda update docutils just in case, use conda update (name). depending on the name

Alright, found the solution
conda install anaconda-clean
anaconda-clean --yes
conda update --all
Should resolve the issue.

Just encountered this. What worked for me was:
conda update conda
conda update anaconda
conda update conda
conda update anaconda
Note that in my case this needed to be run in this specific order (with repeats).

Related

Updating Spyder in Anaconda to 5.2.2

I feel like I'm going absolutely insane as I can't find any information on this anywhere... Is there anyway to update Spyder in Anaconda Navigator to version 5.2.2? The navigator shows that the highest possible version for Spyder is 5.1.5:
I particularly want to update to 5.2.2 because the debugger in 5.1.5 is broken, and it seems the only correct way to fix it is to update to 5.2.2. See Link to stackoverflow stating that one needs to update to 5.2.2 to fix the debugger
I've tried:
conda install spyder==5.2.2
but it just says "PackagesNotFoundError: The following packages are not available from current channels: - spyder==5.2.2"
I've also tried:
pip install spyder==5.2.2
But get the error "ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\Users\##\Anaconda3\envs\spyder\Lib\site-packages\PyQt5\QtCore.pyd'
Consider using the --user option or check the permissions."
Also trying,
pip install spyder==5.2.2 --user
The command does seem to run to completion without error, but the IDE doesn't seem to have updated as it still says it's 5.1.5 and it also says some things about a warning of missing dependencies (and the debugger still doesn't work).
Any suggestions?
Spyder 5.2.2 is only available for the moment through the conda-forge channel. To install it I recommend you to create a new env using only conda-forge packages. You can do that by running from an Anaconda prompt something like the following:
conda create -n spyder-env -c conda-forge python=3.9 spyder=5.2.2
To check what is the latest version available in the different channels you can go to https://anaconda.org/search?q=spyder
Edit: Currently Spyder 5.2.2 is available from the default anaconda channel. However, the latest Spyder release currently is 5.3.2. Just in case, the conda command to get the latest Spyder version installed in a new env with Python 3.9 looks something like:
conda create -n spyder-env -c conda-forge python=3.9 spyder
I have run the following in command prompt window. It has helped
conda remove spyder
conda remove python-language-server
conda update anaconda
conda install spyder=5.2.2

Conda-pack: CondaPackError: files managed by conda were

So, I have a python project where all my tests run but then I do:
conda install -y conda-pack
which succeeds and when I run:
conda-pack
I get a lengthy complaint:
Collecting packages...
CondaPackError:
Files managed by conda were found to have been deleted/overwritten in the
following packages:
- conda-pack 0.6.0:
lib/python3.1/site-packages/conda_pack-0.6.0.dist-info/INSTALLER
lib/python3.1/site-packages/conda_pack-0.6.0.dist-info/LICENSE.txt
lib/python3.1/site-packages/conda_pack-0.6.0.dist-info/METADATA
+ 19 others
- types-requests 2.26.0:
lib/python3.1/site-packages/requests-stubs/METADATA.toml
lib/python3.1/site-packages/requests-stubs/__init__.pyi
lib/python3.1/site-packages/requests-stubs/adapters.pyi
+ 41 others
- jsonschema 4.2.1:
lib/python3.1/site-packages/jsonschema-4.2.1.dist-info/COPYING
lib/python3.1/site-packages/jsonschema-4.2.1.dist-info/INSTALLER
lib/python3.1/site-packages/jsonschema-4.2.1.dist-info/METADATA
+ 39 others
- types-setuptools 57.4.2:
lib/python3.1/site-packages/pkg_resources-stubs/METADATA.toml
lib/python3.1/site-packages/pkg_resources-stubs/__init__.pyi
lib/python3.1/site-packages/pkg_resources-stubs/py31compat.pyi
+ 56 others
<snip>
I see no issues in conda list and I can still run my tests. I see no issues with my environment. Ideas?
This should be related to this issue: https://github.com/conda/conda-pack/issues/198
The root cause is that the image is trying to use python3.10 and conda-pack parse it as python3.1.
They claimed to have fixed it in conda-pack 0.7.0 (release note) but I was using 0.7.0 and still see this problem.
One workaround is to specify another python version in a new env:
conda create -n new_env python=3.9 ${other_packages}
conda install conda-pack
conda-pack -n new_env ${your_other_options}
I think the problem is still there in conda-pack 0.7.0 in the unix-world and will only appear for python 3.10 and upward. It might be dependent on the conda version, but many users do not have the rights to update conda (as is the case for me). Reason are the symbolic links generated by python, which direct python 3.1 packages/programs to python 3.10. Conda-pack does not understand that correctly und searches for python3.1 files.
Solution is a) to update conda if possible b) if that fails to exclude those python3.1 references (running conda-pack in the environment, say myenv, you want to pack - will generate myenv.tar.gz):
conda-pack -f --ignore-missing-files --exclude lib/python3.1

conda update -n base -c defaults conda won't update to 4.6.x

Hopefully the title says most of it. When I use conda, it informs me that there's a newer version; however, when I go to install conda, it refuses to install anything beyond 4.5.11. This problem is occurring on my laptop (running OS X Mojave). The Ubuntu virtual machine I'm running does not have this problem. It's been 9 days and no one has replied to my conda Github issue, so I was hoping that someone here might be able to help out. That link contains relevant configuration details that may offer some clues.
$ conda update -n base -c defaults conda
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.11
latest version: 4.6.4
Please update conda by running
$ conda update -n base -c defaults conda
# All requested packages already installed.
I encountered a similar problem, except that conda was reporting that I needed to update from 4.6.x to 4.7.x and that I needed to update by running:
conda update -n base -c defaults conda
None of the other answers (as of the time I'm typing this) did the job immediately:
My system only has Python 3, so a 2/3 issue wasn't the problem.
Checking on torch and torchvision, I found that they were not part of my Anaconda installation, so that was not the problem either.
Just trying to update Python didn't resolve the issue, as attempts to update conda still did not do anything.
On something of a whim, I ran
conda update anaconda
That did a a lot of updates (far more than should be listed here), which I then followed with:
conda update python
Again, there were many updates done; looking through the list, it was in this step that the conda update actually got done. Nonetheless, I still ran:
conda update conda
A few more updates were done at this point and these turned out to be the last ones. However, for good measure I ran:
conda update -n base -c defaults conda
To update conda to the most recent version you have to update python:
(base) self#home:~$ conda update python
This updates many packages including:
conda: 4.5.11-py35_0 --> 4.6.11-py36_0
This issue was due to a conflict with a PyTorch installation in base. I removed torch and torchvision from the base env and this fixed the dependency snag.
Loop in conda update problem, and finally I typed which python and found python2.7.
Maybe it's python version problem, you just need to update the python to python3.

anaconda update all possible packages?

I tried the conda search --outdated, there are lots of outdated packages, for example the scipy is 0.17.1 but the latest is 0.18.0. However, when I do the conda update --all. It will not update any packages.
update 1
conda update --all --alt-hint
Fetching package metadata .......
Solving package specifications: ..........
# All requested packages already installed.
# packages in environment at /home/user/opt/anaconda2:
#
update 2
I can update those packages separately. I can do conda update scipy. But why I cannot update all of them in one go?
TL;DR: dependency conflicts: Updating one requires (by it's requirements) to downgrade another
You are right:
conda update --all
is actually the way to go1. Conda always tries to upgrade the packages to the newest version in the series (say Python 2.x or 3.x).
Dependency conflicts
But it is possible that there are dependency conflicts (which prevent a further upgrade). Conda usually warns very explicitly if they occur.
e.g. X requires Y <5.0, so Y will never be >= 5.0
That's why you 'cannot' upgrade them all.
Resolving
Update 1: since a while, mamba has proven to be an extremely powerful drop-in replacement for conda in terms of dependency resolution and (IMH experience) finds solutions to problems where conda fails. A way to invoke it without installing mamba is via the --solver=libmamba flag (requires conda-libmamba-solver), as pointed out by matteo in the comments.
To add: maybe it could work but a newer version of X working with Y > 5.0 is not available in conda. It is possible to install with pip, since more packages are available in pip. But be aware that pip also installs packages if dependency conflicts exist and that it usually breaks your conda environment in the sense that you cannot reliably install with conda anymore. If you do that, do it as a last resort and after all packages have been installed with conda. It's rather a hack.
A safe way you can try is to add conda-forge as a channel when upgrading (add -c conda-forge as a flag) or any other channel you find that contains your package if you really need this new version. This way conda does also search in this places for available packages.
Considering your update: You can upgrade them each separately, but doing so will not only include an upgrade but also a downgrade of another package as well. Say, to add to the example above:
X > 2.0 requires Y < 5.0, X < 2.0 requires Y > 5.0
So upgrading Y > 5.0 implies downgrading X to < 2.0 and vice versa.
(this is a pedagogical example, of course, but it's the same in reality, usually just with more complicated dependencies and sub-dependencies)
So you still cannot upgrade them all by doing the upgrades separately; the dependencies are just not satisfiable so earlier or later, an upgrade will downgrade an already upgraded package again. Or break the compatibility of the packages (which you usually don't want!), which is only possible by explicitly invoking an ignore-dependencies and force-command. But that is only to hack your way around issues, definitely not the normal-user case!
1 If you actually want to update the packages of your installation, which you usually don't. The command run in the base environment will update the packages in this, but usually you should work with virtual environments (conda create -n myenv and then conda activate myenv). Executing conda update --all inside such an environment will update the packages inside this environment. However, since the base environment is also an environment, the answer applies to both cases in the same way.
To answer more precisely to the question:
conda (which is conda for miniconda as for Anaconda) updates all but ONLY within a specific version of a package -> major and minor. That's the paradigm.
In the documentation you will find "NOTE: Conda updates to the highest version in its series, so Python 2.7 updates to the highest available in the 2.x series and 3.6 updates to the highest available in the 3.x series."
doc
If Wang does not gives a reproducible example, one can only assist.
e.g. is it really the virtual environment he wants to update or could Wang get what he/she wants with
conda update -n ENVIRONMENT --all
*PLEASE read the docs before executing "update --all"!
This does not lead to an update of all packages by nature. Because conda tries to resolve the relationship of dependencies between all packages in your environment, this can lead to DOWNGRADED packages without warnings.
If you only want to update almost all, you can create a pin file
echo "conda ==4.0.0" >> ~/miniconda3/envs/py35/conda-meta/pinned
echo "numpy 1.7.*" >> ~/miniconda3/envs/py35/conda-meta/pinned
before running the update. conda issues not pinned
If later on you want to ignore the file in your env for an update, you can do:
conda update --all --no-pin
You should not do update --all. If you need it nevertheless you are saver to test this in a cloned environment.
First step should always be to backup your current specification:
conda list -n py35 --explicit
(but even so there is not always a link to the source available - like for jupyterlab extensions)
Next you can clone and update:
conda create -n py356 --clone py35
conda activate py356
conda config --set pip_interop_enabled True # for conda>=4.6
conda update --all
conda config
update:
Currently I would use mamba (or micromamba) as conda pkg-manager replacement
update:
Because the idea of conda is nice but it is not working out very well for complex environments I personally prefer the combination of nix-shell (or lorri) and poetry [as superior pip/conda .-)] (intro poetry2nix).
Alternatively you can use nix and mach-nix (where you only need you requirements file. It resolves and builds environments best.
On Linux / macOS you could use nix like
nix-env -iA nixpkgs.python37
to enter an environment that has e.g. in this case Python3.7 (for sure you can change the version)
or as a very good Python (advanced) environment you can use mach-nix (with nix) like
mach-nix env ./env -r requirements.txt
(which even supports conda [but currently in beta])
or via api like
nix-shell -p nixFlakes --run "nix run github:davhau/mach-nix#with.ipython.pandas.seaborn.bokeh.scikit-learn "
Finally if you really need to work with packages that are not compatible due to its dependencies, it is possible with technologies like NixOS/nix-pkgs.
Imagine the dependency graph of packages, when the number of packages grows large, the chance of encountering a conflict when upgrading/adding packages is much higher. To avoid this, simply create a new environment in Anaconda.
Be frugal, install only what you need. For me, I installed the following packages in my new environment:
pandas
scikit-learn
matplotlib
notebook
keras
And I have 84 packages in total.
I agree with Mayou36.
For example, I was doing the mistake to install new packages in the base environment using conda for some packages and pip for some other packages.
Why this is bad?
1.None of this is going to help with updating packages that have been > installed >from PyPI via pip, or any packages installed using python
setup.py install. conda list will give you some hints about the
pip-based Python packages you have in an environment, but it won't do
anything special to update them.
And I had all my projects in the same one environment! And I used update all -which is bad and did not update all-.
So, the best thing to do is to create a new environment for each project. Why?
2. A Conda environment is a directory that contains a specific collection of Conda packages that you have installed. For example, you
may be working on a research project that requires NumPy 1.18 and its
dependencies, while another environment associated with an finished
project has NumPy 1.12 (perhaps because version 1.12 was the most
current version of NumPy at the time the project finished). If you
change one environment, your other environments are not affected. You
can easily activate or deactivate environments, which is how you
switch between them.
So, to wrap it up:
Create a new environment for each project
Be aware for the differences in conda and pip
3.Only include the packages that you will actually need and update them properly only if necessary.
if working in MS windows, you can use Anaconda navigator. click on the environment, in the drop-down box, it's "installed" by default. You can select "updatable" and start from there
To update all possible packages I used conda update --update-all
It works!
I solved this problem with conda and pip.
Firstly, I run:
conda uninstall qt and conda uninstall matplotlib and conda uninstall PyQt5
After that, I opened the cmd and run this code that
pip uninstall qt , pip uninstall matplotlib , pip uninstall PyQt5
Lastly, You should install matplotlib in pip by this code that pip install matplotlib

Tensorflow and Anaconda on Ubuntu?

On my Ubuntu 14.04, I have installed tensorflow, using "pip", as specified in the Tensorflow Installation instructions and I made sure it was working by importing it in python and it did work.
Then, I installed Anaconda and it changed my .bashrc file by adding the following line to it:
export PATH="/home/sonny/anaconda2/bin:$PATH"
But because of this change, now it looks into the PATH above, which doesn't contain tensorflow. now I can't import tensorflow in my python code.
What is the proper way to extend the $PATH environment variable so that it stays using everything from anaconda2 but it becomes able to import "tensorflow"?
I solved the problem but in a different way!
I found a link where the tensorflow.whl files were converted to conda packages, so I went ahead and installed it using the command:
conda install -c https://conda.anaconda.org/jjhelmus tensorflow
and it worked, since the $PATH points to anaconda packages, I can import it now!
Source is here
Since v0.10.0, tensorflow is a community maintained conda package in the conda-forge channel. Hence, it can be installed directly with the following command:
conda install -c conda-forge tensorflow
The instructions on the TensorFlow documentation has also been updated.
To facilitate future updates, it is probably a good idea to add conda-forge channel into your conda config:
conda config --add channels conda-forge
In fact, tensorflow=0.10.0rc0 was recently added onto the Anaconda default channel and will be installed instead if the conda-forge channel is not specified:
conda install tensorflow
I had the same problem and decided it was easiest to start over, install Anaconda first and then TensorFlow after that.
I suspect that pip is giving you a TensorFlow installation in cpython, not anaconda.
How about a virtualenv?
# Create env
$ virtualenv --python=/path/to/anaconda /path/to/your/env
# Activate env
$ source /path/to/your/env/bin/activate
# Install Tensorflow
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Install tensorflow from the following command. Conda will take care of the installation process.
conda install -c conda-forge tensorflow
I solved the problem using this:
conda create --name=tensorenv python=3.4
source activate tensorenv
Actually, the TensorFlow Official website made every detail of installing.
The Operation System Windows, Mac OS, Ubuntu; the environment with GPU or just CPU, every single detail of problems you may come up with.
Check this out
Installing TensorFlow on Ubuntu with Anaconda
you will not regret.
Once you visit that you may also find like
Installing TensorFlow on Windows with Anaconda

Categories

Resources