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 @@

Table of Contents

-
-

Getting information about your Git repository

-
+
+

Getting information about your Git repository

+

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.

-
-

Getting information about Python(3) libraries

-
+
+

Getting information about Python(3) libraries

+
-
-

Getting the list of installed packages and their version

-
+
+

Getting the list of installed packages and their version

+

-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
 
- -
-
-
-
-
-

How to list imported modules?

-
+
+

How to list imported modules?

+

-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).

@@ -236,9 +243,9 @@ zlib 1.0
-
-

Setting up an environment with pip

-
+
+

Setting up an environment with pip

+

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.

-
-

Getting information about R libraries

-
+
+

Getting information about R libraries

+

The best way seems to be to rely on the devtools package.

@@ -322,6 +329,258 @@ Some actually advocate that writing can be done by writing an R package. Those of you willing to have a clean R dependency management should thus have a look at Packrat.

+ +

+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())
+
+
+ + + + +++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageLibPathVersionPriorityDependsImportsLinkingToSuggestsEnhancesLicenseLicenseisFOSSLicenserestrictsuseOStypeMD5sumNeedsCompilationBuilt 
BH/home/alegrand/R/x8664-pc-linux-gnu-library/3.51.66.0-1nilnilnilnilnilnilBSL-1.0nilnilnilnilno3.5.1 
Formula/home/alegrand/R/x8664-pc-linux-gnu-library/3.51.2-3nilR (>= 2.0.0), statsnilnilnilnilGPL-2GPL-3nilnilnilnilno3.5.1
Hmisc/home/alegrand/R/x8664-pc-linux-gnu-library/3.54.1-1nillattice, 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, base64encnilchron, rms, mice, tables, knitr, ff, ffbase, plotly (>=              
4.5.6)nilGPL (>= 2)nilnilnilnilyes3.5.1        
Matrix/home/alegrand/R/x8664-pc-linux-gnu-library/3.51.2-14recommendedR (>= 3.2.0)methods, graphics, grid, stats, utils, latticenilexpm, MASSMatrixModels, graph, SparseM, sfsmiscGPL (>= 2)file LICENCEnilnilnilnilyes3.5.1
StanHeaders/home/alegrand/R/x8664-pc-linux-gnu-library/3.52.17.2nilnilnilnilRcppEigen, BHnilBSD3clause + file LICENSEnilnilnilnilyes3.5.1 
acepack/home/alegrand/R/x8664-pc-linux-gnu-library/3.51.4.1nilnilnilniltestthatnilMIT + file LICENSEnilnilnilnilyes3.5.1