Strumenti Utente

Strumenti Sito


calcoloscientifico:userguide:python

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
calcoloscientifico:userguide:python [27/08/2025 17:41] fabio.spatarocalcoloscientifico:userguide:python [27/08/2025 18:13] (versione attuale) fabio.spataro
Linea 11: Linea 11:
   - python/3.11.5   - python/3.11.5
  
-==== Python virtualenv ====+===== Python virtualenv =====
  
 [[https://virtualenv.pypa.io/en/stable|Virtualenv]] is a tool to create isolated Python environments. [[https://virtualenv.pypa.io/en/stable|Virtualenv]] is a tool to create isolated Python environments.
  
-=== Python 2.7.14 virtualenv ===+==== Python 2.7.14 virtualenv ====
  
-Create a virtual environment for "machine-learning":+Create a virtual environment for ''machine-learning'':
  
 <code> <code>
Linea 31: Linea 31:
 </code> </code>
  
-Activate "machine-learningvirtual environment:+Activate ''machine-learning'' virtual environment:
  
 <code> <code>
Linea 37: Linea 37:
 </code> </code>
  
-Install packages in "machine-learningvirtual environment:+Install packages in ''machine-learning'' virtual environment:
  
 <code> <code>
Linea 43: Linea 43:
 </code> </code>
  
-Deactivate "machine-learningvirtual environment:+Deactivate ''machine-learning'' virtual environment:
  
 <code> <code>
Linea 49: Linea 49:
 </code> </code>
  
-=== Python 3.6.3 virtualenv ===+==== Python 3.6.3 virtualenv ====
  
 Available virtual environments for Python 3.6.3: Available virtual environments for Python 3.6.3:
Linea 56: Linea 56:
   * tensorflow-gpu   * tensorflow-gpu
  
-== Site installation ==+=== Site installation ===
  
-Activate "opencvvirtual environment:+Activate ''opencv'' virtual environment:
  
 <code> <code>
Linea 69: Linea 69:
 ---- ----
  
-Activate "tensorflowvirtual environment:+Activate ''tensorflow'' virtual environment:
  
 <code> <code>
Linea 80: Linea 80:
 ---- ----
  
-Activate "tensorflow-gpuvirtual environment:+Activate ''tensorflow-gpu'' virtual environment:
  
 <code> <code>
Linea 99: Linea 99:
 </code> </code>
  
-== User installation ==+=== User installation ===
  
-Create "opencvvirtual environment (just once):+Create ''opencv'' virtual environment (just once):
  
 <code> <code>
Linea 110: Linea 110:
 </code> </code>
  
-Update "opencvvirtual environment (every time you want to update):+Update ''opencv'' virtual environment (every time you want to update):
  
 <code> <code>
Linea 119: Linea 119:
 </code> </code>
  
-Activate "opencvvirtual environment:+Activate ''opencv'' virtual environment:
  
 <code> <code>
Linea 130: Linea 130:
 ---- ----
  
-Create "tensorflowvirtual environment (just once):+Create ''tensorflow'' virtual environment (just once):
  
 <code> <code>
Linea 139: Linea 139:
 </code> </code>
  
-Update "tensorflowvirtual environment (every time you want to update):+Update ''tensorflow'' virtual environment (every time you want to update):
  
 <code> <code>
Linea 148: Linea 148:
 </code> </code>
  
-Activate "tensorflowvirtual environment:+Activate ''tensorflow'' virtual environment:
  
 <code> <code>
Linea 159: Linea 159:
 ---- ----
  
-Create "tensorflow-gpuvirtual environment (just once):+Create ''tensorflow-gpu'' virtual environment (just once):
  
 <code> <code>
Linea 168: Linea 168:
 </code> </code>
  
-Update "tensorflow-gpuvirtual environment (every time you want to update):+Update ''tensorflow-gpu'' virtual environment (every time you want to update):
  
 <code> <code>
Linea 177: Linea 177:
 </code> </code>
  
-Activate "tensorflow-gpuvirtual environment:+Activate ''tensorflow-gpu'' virtual environment:
  
 <code> <code>
Linea 196: Linea 196:
 </code> </code>
  
-=== Python 3.6.8 virtualenv ===+==== Python 3.6.8 virtualenv ====
  
-== User installation == +=== User installation ===
- +
-Create ''myvenv_with_jupyter'' virtual environment (just once): +
- +
-<code> +
-mkdir -p "$HOME/local/tools/python/3.6.8/virtualenv/myvenv_with_jupyter" +
-python3 -m venv "$HOME/local/tools/python/3.6.8/virtualenv/myvenv_with_jupyter" +
-. "$HOME/local/tools/python/3.6.8/virtualenv/myvenv_with_jupyter/bin/activate" +
-python3 -m pip install --upgrade pip +
-python3 -m pip install --upgrade jupyter notebook ipyparallel +
-#python3 -m pip install --upgrade other_packages_for_my_project +
-deactivate +
-</code> +
- +
-Update ''myvenv_with_jupyter'' virtual environment (every time you want to update): +
- +
-<code> +
-. "$HOME/local/tools/python/3.6.8/virtualenv/myvenv_with_jupyter/bin/activate" +
-python3 -m pip install --upgrade pip +
-python3 -m pip install --upgrade jupyter notebook ipyparallel +
-#python3 -m pip install --upgrade other_packages_for_my_project +
-deactivate +
-</code>+
  
 Require a node with ''srun'': Require a node with ''srun'':
Linea 238: Linea 216:
 </code> </code>
  
-Activate "myvenv_with_jupyter" virtual environment:+Create ''my_venv_with_jupyter'' virtual environment (just once): 
 + 
 +<code> 
 +mkdir -p "$HOME/local/tools/python/3.6.8/virtualenv/my_venv_with_jupyter" 
 +python3 -m venv "$HOME/local/tools/python/3.6.8/virtualenv/my_venv_with_jupyter" 
 +source "$HOME/local/tools/python/3.6.8/virtualenv/my_venv_with_jupyter/bin/activate" 
 +python3 -m pip install --upgrade pip 
 +python3 -m pip install --upgrade jupyter notebook ipyparallel 
 +#python3 -m pip install --upgrade other_packages_for_my_project 
 +deactivate 
 +</code> 
 + 
 +Update ''my_venv_with_jupyter'' virtual environment (every time you want to update): 
 + 
 +<code> 
 +source "$HOME/local/tools/python/3.6.8/virtualenv/my_venv_with_jupyter/bin/activate" 
 +python3 -m pip install --upgrade pip 
 +python3 -m pip install --upgrade jupyter notebook ipyparallel 
 +#python3 -m pip install --upgrade other_packages_for_my_project 
 +deactivate 
 +</code> 
 + 
 +Activate ''my_venv_with_jupyter'' virtual environment:
  
 <code> <code>
-"$HOME/local/tools/python/3.6.8/virtualenv/myvenv_with_jupyter/bin/activate"+source "$HOME/local/tools/python/3.6.8/virtualenv/my_venv_with_jupyter/bin/activate"
 </code> </code>
  
-Start the Jupyter Notebook Server:+Start the ''Jupyter Notebook Server'':
  
 <code> <code>
Linea 255: Linea 255:
 Open another shell and run the following command: Open another shell and run the following command:
  
-ssh -N -L 127.0.0.1:*****:wn92.hpc.unipr.it:***** ***.***@login.hpc.unipr.it+ssh -N -L 127.0.0.1:*****:wn**.hpc.unipr.it:***** ***.***@login.hpc.unipr.it
  
 To access the notebook, open in a browser the URL which starts with To access the notebook, open in a browser the URL which starts with
Linea 261: Linea 261:
 </code> </code>
  
-Stop the Jupyter Notebook Server:+Stop the ''Jupyter Notebook Server'':
  
 Press ''CTRL'' + ''C''. Press ''CTRL'' + ''C''.
calcoloscientifico/userguide/python.1756309260.txt.gz · Ultima modifica: da fabio.spataro

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki