Skip to content
Advertisement

How to install Python packages under Linux environment?

Recently I am using the virtual machine to do the Python coding. The system is under Linux, which means I have to use Command Lines to install the Python packages. I am familiar with Anaconda to do Python coding at school. But in the real working environment, to save money, I have to use Linux.

Now I have a problem in installing the Python packages. Like I used to use pip to install, now I have to use Sudo. There is some information about how to install from the website, for

$ sudo apt install Python-pandas

But I don’t know how to install the class. For example, I would like to conduct a linear regression analysis. I installed the sklearn successfully.

$ sudo apt install python-sklearn

How can I install sklearn.linear_model and import LinearRegression and how to import train_test_split from sklearn.corss_validation?

Can I do it in eclipse? Or the only way is to install in Linux. Anyone can help?

Advertisement

Answer

  1. you can install anaconda in linux
  2. the package includes all of the classes
  3. sudo is all lower case
  4. you can still use sudo pip install or pip install --user
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement