Python Anaconda: how to check if updated libraries are compatible with my existing code?

I am using the Pacon 2.7 Anaconda installation on a computer running Windows 7 for data analysis and scientific computing.

When new libraries were released (for example, the new version of pandas, patsy, etc.), how would you recommend checking the compatibility of the new version with my existing code? Is it possible to have two Anaconda installations on the same machine? Would you recommend some kind of virtual environment? Is there an easy way to revert to previous versions of the library using Anaconda?

I ask because I spent most of last week trying to understand why my previous code no longer works with new versions of pandas and patsy. No need to comment on how I am because of this ...

By the way, it also shows that Python is a potentially interesting language for data analysis and scientific computing, but only potentially. Major libraries are too unstable and immature. pandas was released about 3 1/2 years ago, and we are still very far from version 1.0, so I do not hope that things will get better in time. Imagine if each new release of Matlab required a serious rewrite of all your code: Mathworks would have long gone out of business!

+4
source share
2 answers

You can install specific versions of all the dependencies in a separate virtual environment and test your module there. This can be achieved using the following workflow,

$ conda create --yes -n new_env pip numpy=1.9 pandas=0.16 python=2 # specify the required versions
$ activate new_env
$ # install and test your module
$ deactivate

, .

, - , IMHO python (numpy, scipy pandas ) . 1.0. , , , , , .

/, . (CI) , , - .

+4

conda

# Replace update-tests with whatever you want to call the environment
# Replace root with the environment name if you use a non-root environment
conda create -n update-tests --clone root

conda install -n update-tests pandas=0.16 ...

,

# On non-Windows this would be 'source activate update-tests'
activate update-tests

# Would be 'source deactivate' on non-Windows
deactivate
+1

Source: https://habr.com/ru/post/1584512/