I recently discovered my numpy
installation (MacOS, with anaconda) was on an old version 1.11.x, instead of the latest 1.12.0, when a function documented on their website was not found. When I would type conda update numpy
, I would be told the installation is up to date. Finally after trying to force conda install numpy=1.12.0
, an error showed up indicating packages had dependency issues -- turns out my astropy
installation (which I don't even use) required numpy version 1.11.x. After uninstalling astropy
and installing numpy
, the upgrade to version 1.12.0 was successful.
It really bothers me that anaconda did not give any sort of notice that it was ignoring the latest numpy
version due to dependency issues. Is there any way to display, by force, some kind of warning or flag?
Edit: I see from this github issue thread that there seems to be no native way to do this, at the moment. Though perhaps until the developers add the feature, there is a slightly hacky way it can be done with a BASH script -- something like querying the latest version available, then conda installing and comparing the two version strings.
To prevent existing packages from updating, use the --no-update-deps option. This may force conda to install older versions of the requested packages, and it does not prevent additional dependency packages from being installed.
Conda provides many of the features found in pip, virtualenv, venv and pyenv. However it is a completely separate tool that will manage Python dependencies differently, and only works in Conda environments. Conda analyzes each package for compatible dependencies, and how to install them without conflict.
Built into Anaconda, conda is a powerful package manager and environment manager that you use with command-line in the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. pip is the standard package manager for python, meaning you can use it both inside and outside of Anaconda.
You are asking if it is possible to write code that will scan each line of environment.yml
and report whether the "foo=X.Y.Z" version for foo is up-to-date, ignoring other deps in the file (like astropy) which might conflict and therefore hold it back.
Yes.
Write a script that iterates through each package line, tears down and then rebuilds a brand new environment with a one-line environment.yml (or even without that file), and installs the latest version in isolation. Read whatever version that turns out to be, compare against the target environment.yml, and report on any mismatches. If you write a script that you find useful, please do post it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With