entornos python

De Wikicima
(Diferencias entre revisiones)
Saltar a: navegación, buscar
Línea 39: Línea 39:
 
</pre>
 
</pre>
   
# Deactivating environment
+
# To know which packages are installed
 
<pre>
 
<pre>
(py27env) $ deactivate
+
(py27env) $ pip freeze
$
+
numpy==1.13.3
 
</pre>
 
</pre>
   
# To know which packages are installed
+
# Deactivating environment
 
<pre>
 
<pre>
$ pip freeze
+
(py27env) $ deactivate
numpy==1.13.3
+
$
 
</pre>
 
</pre>

Revisión de 17:41 2 nov 2017

The generation of environments facilitate the specific requiremnts of each user for each purpose.

Following instructions from python environments

  1. Creation of the place where the environment will reside
mkdir -p {HOME}/bin/py27env
cd {HOME}/bin/py27env
  1. Install virtualenv
$ pip install virtualenv
  1. Test installation
$ virtualenv --version
  1. Create a virtual environment (e.g `py27env' to be used with python 2.7):
$ virtualenv p /usr/bin/python2.7 ./
  1. Activate the environment
$ source bin/activate
(py27env) $
  1. Installing packages
(py27env) $ pip install numpy
Collecting numpy
  Using cached numpy-1.13.3-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.13.3
  1. To know which packages are installed
(py27env) $ pip freeze
numpy==1.13.3
  1. Deactivating environment
(py27env) $ deactivate
$ 
Herramientas personales