Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:soft_utilisation_de_python_au_centre_de_calcul [2017/04/20 15:15]
David BOUVET
en:soft_utilisation_de_python_au_centre_de_calcul [2017/11/14 17:40] (current)
David BOUVET
Line 17: Line 17:
 </​code>​ </​code>​
 Your file should also have the "​executable"​ UNIX characteristic because Python is an interpreted language. You should not generated an binary executable in the sense of programming languages as C, C++ or Fortran. Your file should also have the "​executable"​ UNIX characteristic because Python is an interpreted language. You should not generated an binary executable in the sense of programming languages as C, C++ or Fortran.
 +
 +To load Python environment:​
 +<​code>​
 +$ . python_env.sh <​version>​
 +</​code>​
 +Running the command without the version will list the available versions.
  
 \\ \\
 You have also the option of installing locally the python packages you need without administrator rights on the machines. To do this, please follow the procedure below: You have also the option of installing locally the python packages you need without administrator rights on the machines. To do this, please follow the procedure below:
 <​code>​ <​code>​
-python33_env +. python_env.sh 3.3 
-pyvenv ​"​my_new_env"​+python -m venv --system-site-packages ​"​my_new_env"​
 $ source "​my_new_env"/​bin/​activate $ source "​my_new_env"/​bin/​activate
 (my_new_env) $ python -m pip install --user my_module (my_new_env) $ python -m pip install --user my_module
 </​code>​ </​code>​
  
-The first command loads the Python 3.3 environment required for using pyvenv. The following command is used to create an "​environment"​ from the given directory "​my_new_env",​ the directory in which the new Python packages will be installed and configured (see [1]). The third command tells the system to use this environment [1]. The last command requests Python via the "​pip"​ module to install the new module "​my_module"​ [2].+The first command loads the Python 3.3 environment required for using venv (venv command is available since version 3.3). The following command is used to create an "​environment"​ from the given directory "​my_new_env",​ the directory in which the new Python packages will be installed and configured (see [1]). The third command tells the system to use this environment [1]. The last command requests Python via the "​pip"​ module to install the new module "​my_module"​ [2].
  
 You can then see the installed package: You can then see the installed package:
Line 36: Line 42:
 </​code>​ </​code>​
  
-[1] https://docs.python.org/​3/using/​scripts.html#scripts-pyvenv +[1] https://packaging.python.org/​installing/#creating-virtual-environments 
-\\ https://packaging.python.org/​installing/#​creating-virtual-environments+\\ https://docs.python.org/​3/library/​venv.html
  
 [2] https://​docs.python.org/​3/​installing/ ​ [2] https://​docs.python.org/​3/​installing/ ​
  • en/soft_utilisation_de_python_au_centre_de_calcul.txt
  • Last modified: 2017/11/14 17:40
  • by David BOUVET