diff --git a/module4/ressources/resources.html b/module4/ressources/resources.html index 6e510c4f089ac8734880d52a30254b4d79ff2a71..3bb5d77082d5fe3a9a5ddc59277ba515c1e9b637 100644 --- a/module4/ressources/resources.html +++ b/module4/ressources/resources.html @@ -3,22 +3,22 @@
When taking notes, it may be difficult to remember which version of the code or of a file was used. This is what version control is useful @@ -104,15 +104,19 @@ is the price to pay for running git from within the notebook itself.
-https://stackoverflow.com/questions/20180543/how-to-check-version-of-python-modules
+This topic is discussed on StackOverflow. When using pip
(the Python
+package installer) within a shell command, it is easy to query the
+version of all installed packages (note that on your system, you may
+have to use either pip
or pip3
depending on how it is named and which
+versions of Python are available on your machine.
pip3 freeze @@ -139,6 +143,12 @@ wcwidth==0.1.7 webencodings==0.5+
+Once you know which packages are installed, you can easily get +additional information about a given package and in particular check +whether it was installed "locally" through pip or whether it is +installed system-wide. Again, in a shell command: +
pip3 show pandas echo " " @@ -167,21 +177,18 @@ License: BSD License Location: /home/alegrand/.local/lib/python3.6/site-packages Requires: patsy, pandas- -
--
-Inspiring from StackOverflow, here is a simple function that lists
-loaded package (that have a __version__
attribute, which is
-unfortunately not completely standard).
+Without resorting to pip (that will list all available packages), you
+may want to know which modules are loaded in a Python session as well
+as their version. Inspiring from StackOverflow, here is a simple
+function that lists loaded package (that have a __version__
attribute,
+which is unfortunately not completely standard).
The easiest way to go is as follows:
@@ -249,16 +256,16 @@ pip3 install -r requirements.txt Pipenv. I doubt it allows to track correctly FORTRAN or C -dynamic libraries that are wrapped by Python. +dynamic libraries that are wrapped by Python though.
The best way seems to be to rely on the devtools
package.
+Finally, it is good to know that there is a built-in R command
+(installed.packages
) allowing to retrieve and list the details of all
+packages installed.
+
head(installed.packages()) ++
Package | +LibPath | +Version | +Priority | +Depends | +Imports | +LinkingTo | +Suggests | +Enhances | +License | +LicenseisFOSS | +Licenserestrictsuse | +OStype | +MD5sum | +NeedsCompilation | +Built | ++ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BH | +/home/alegrand/R/x8664-pc-linux-gnu-library/3.5 | +1.66.0-1 | +nil | +nil | +nil | +nil | +nil | +nil | +BSL-1.0 | +nil | +nil | +nil | +nil | +no | +3.5.1 | ++ |
Formula | +/home/alegrand/R/x8664-pc-linux-gnu-library/3.5 | +1.2-3 | +nil | +R (>= 2.0.0), stats | +nil | +nil | +nil | +nil | +GPL-2 | +GPL-3 | +nil | +nil | +nil | +nil | +no | +3.5.1 | +
Hmisc | +/home/alegrand/R/x8664-pc-linux-gnu-library/3.5 | +4.1-1 | +nil | +lattice, survival (>= 2.40-1), Formula, ggplot2 (>= 2.2) | +methods, latticeExtra, cluster, rpart, nnet, acepack, foreign, | ++ | + | + | + | + | + | + | + | + | + | + |
gtable, grid, gridExtra, data.table, htmlTable (>= 1.11.0), | ++ | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + |
viridis, htmltools, base64enc | +nil | +chron, rms, mice, tables, knitr, ff, ffbase, plotly (>= | ++ | + | + | + | + | + | + | + | + | + | + | + | + | + |
4.5.6) | +nil | +GPL (>= 2) | +nil | +nil | +nil | +nil | +yes | +3.5.1 | ++ | + | + | + | + | + | + | + |
Matrix | +/home/alegrand/R/x8664-pc-linux-gnu-library/3.5 | +1.2-14 | +recommended | +R (>= 3.2.0) | +methods, graphics, grid, stats, utils, lattice | +nil | +expm, MASS | +MatrixModels, graph, SparseM, sfsmisc | +GPL (>= 2) | +file LICENCE | +nil | +nil | +nil | +nil | +yes | +3.5.1 | +
StanHeaders | +/home/alegrand/R/x8664-pc-linux-gnu-library/3.5 | +2.17.2 | +nil | +nil | +nil | +nil | +RcppEigen, BH | +nil | +BSD3clause + file LICENSE | +nil | +nil | +nil | +nil | +yes | +3.5.1 | ++ |
acepack | +/home/alegrand/R/x8664-pc-linux-gnu-library/3.5 | +1.4.1 | +nil | +nil | +nil | +nil | +testthat | +nil | +MIT + file LICENSE | +nil | +nil | +nil | +nil | +yes | +3.5.1 | ++ |