Install Anaconda in your home directory

I established an SSH connection to a remote server. I want to run some of my python programs, so I need to download all the modules that I used.

I just downloaded Ananconda (I do not have root access, so it was set to ~) and added ~ / anaconda / bin to my PATH. However, when I try to import numpy in Python, it says that the module was not found. How to fix it?

+4
source share
3 answers

You are probably using the wrong version of Python.

To check use which -a python

 james@bodacious :~$which -a python /usr/bin/python james@bodacious :~$ 

In my case, I am running the version from / usr / bin / python and that is the only version found in my $ PATH. You should also see the version from ~ / anaconda / bin in your list, and to start it when you enter python it should be at the top.

If this is not the case, you can check your $ PATH and, if necessary, add ~/anaconda/bin to it.

 james@bodacious :~$echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/james/bin james@bodacious :~$PATH=~/anaconda/bin:$PATH james@bodacious :~$echo $PATH /Users/james/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/james/bin james@bodacious :~$ 
+5
source

I do not have any Fedora / Redhat systems, but I believe that you can:

 yum install numpy 

NTN

0
source

You said that all you really need is to be able to use numpy - based on this, using anaconda, perhaps too much.

It looks like you are really asking: "Since I do not have root access and cannot install system packages, how can I configure the python environment in my home directory, which has what I need?"

It sounds like a job for ... Super Grover! no waiting, I meant virtualenv.

Let's hope that your system has already installed a virtual computer for you. If so, just create your own environment using your own set of packages:

 james@bodacious :~$mkdir venv/ james@bodacious :~$cd venv/ james@bodacious :venv$virtualenv . New python executable in ./bin/python Installing Setuptools..............................................................................................................................................................................................................................done. Installing Pip.....................................................................................................................................................................................................................................................................................................................................done. james@bodacious :venv$source bin/activate (venv) james@bodacious :venv$pip install numpy Downloading/unpacking numpy Downloading numpy-1.7.1.zip (3.1MB): 3.1MB downloaded 

Once this is completed, you will have your own copy of numpy, which you can access in this environment simply by using cd venv; source bin/activate cd venv; source bin/activate to set $ PATH and $ PYTHONPATH to point to your custom installation.

If you don't have virtualenv installed yet, things get more complicated ....

-one
source

Source: https://habr.com/ru/post/1493869/


All Articles