Linux Server virtual env

How to create the virtual env in the server of lab.

In my group coursework for the advanced ML, I want to run the code of the first solution in this competition. The requirments wasn’t satisfied in the server, so I want to create virtual env to built such environment. This blog records the process of building envirment to run deep learning task.

virtualenv

If your linux server already has the virtualenv module, you can use virtual env to create virtual environment. You can check it using pip list.

In my try, I tried to install the virtualenv in the beginning. I found that the permmission is denied, since I don’t have the root access on this server supplied by teachers.

I found the reason and solution in this issue. Therefore, I did another try which is the following one.

Python -m venv

1
2
python3 -m venv env
source ./env/bin/activate

This solution just needs you to have the Python in your system (any Linux has the Python within system). In this way, I can activate the virual environment and pip install the specific modules.

我的解决方案

目标:python3.6

过程:

  1. python -m env
  2. 在python创建出来的虚拟环境中安装virtualenv
  3. 通过virtualenv创建对应python3.6版本的虚拟环境

Reference

  1. an issue on Github: Permission denied