by Hanz Makmur
Python has lots of modules that come in many different versions and many different dependencies of specific version. Due to version conflicts, many of these modules conflict with other modules and modules needed by the OS. To avoid these conflicts, we have created a unified python virtual environment for Computer Science CentOS 7.x Linux users to use. Below instruction assumes you are using bash shell.
- To add a path type:
Hint: To skip this step on your next login, add this line to your .bashrc
2. Activate the python environment of your choice.
- To activate python 3.6 environment (latest) type:
source activate python36
- To activate python 3.5 environment type:
source activate python35
- To activate python 2.7 environment type:
source activate python27
Note: Python 2.7 is old, it is provided for compatibilities with older codes. Please update to Python 3.x
3. Other options
- To see list of of available virtual environments, after activating an environment type:
conda env list
- To exit or deactivate python virtual environment, type:
Once your specific python environment activated, you may need Integrated Development Environment (IDE) to simplify your tasks. Here is a list of a few popular and free python IDEs
A. Available on CS Linux machines
- idle : A basic IDE for python27. To run idle in python27 environment type:
- idle3: a basic IDE for python36. To run idle in python35 or python36 environment type:
- spyder: a nice advanced IDE for python. To run spyder in your choice of python environment type:
- jupyter Notebook (iPython): an interactive way to run python code on a browser.
To run jupyter on you need to open a terminal and depending on your session you would choose one of the following options.
If you are in:
- Graphical Session like X2Go, XRDP or Local login, type:
jupyter notebook --ip=`hostname`
this will start jupyter session and automatically open a browser on your graphical session.
- Non Graphical session like ssh type:
jupyter notebook --ip=`hostname` --browser="none"
this start jupyter session but tells you to copy paste URL to your local browser.
NOTE: The ` ` around hostname are backwards quotes. The backward quote key is normally at the upper left of your keyboard.
- eclipse: a common and popular IDE. To run eclipse, type:
eclipseor choose it from the Programming menu.
B. Not available on CS Linux machines
- netbeans. A popular free Java IDE but python language support seems to be neglected on current release of Netbeans.
- pycharm: A nice IDE free to install for your own computer. We don't have licenses to install on our environment due to their license complex restrictions.
- Rodeo: A nice RStudio feel IDE but have issues that have not been resolved since the founders have left. We dont have this on our system.
pip install --helpExample, you can install a module using
pip --install module_name --user
This command essentially install the module in your local path. To findout where the module is installed type
python -m site --user-site