First, log in to the server with the user account for which you want to build a Python environment. After that, execute the following command in your home directory.
$ git clone https://github.com/yyuu/pyenv.git .pyenv
$ mkdir .pyenv/shims .pyenv/versions
$ cd .pyenv/plugins
$ git clone https://github.com/yyuu/pyenv-virtualenv.git
After completing the above command, add the following program to **. Bashrc **.
export PYENV_ROOT=~/.pyenv
export PATH=~/.pyenv/shims:~/.pyenv/bin:/usr/local/bin:$PATH
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
After that, you can reflect the environment variables by executing the following command.
$ source .bashrc
To transfer the files in your local environment to the server, run the ** scp ** command. The usage of scp is as follows.
scp Path of the file you want to transfer on your local environment Username@Remote host name:Destination path
Let's take an example to make it easier to understand. Suppose each element is given in the specific example below. In that case, it will be as follows.
element | Concrete example |
---|---|
I want to transfer on the local environment File path |
/usr/home/box/data.txt |
User name | chocolate |
Remote host name | apple |
Destination path | /home/chocolate |
#When transferring files
scp /usr/home/box/data.txt chocolate@apple:/home/chocolate
#When transferring the entire folder
scp -r /usr/home/box chocolate@apple:/home/chocolate
Recommended Posts