installing python modules that require gcc on shared hosting with no gcc or root access
https://stackoverflow.com/questions/26201141/installing-python-modules-that-require-gcc-on-shared-hosting-with-no-gcc-or-root
https://stackoverflow.com/questions/7645381/python-importing-modules-on-shared-server



How to Create Your Own Python Environment Locally in Your Shared Hosting Account
https://blog.arvixe.com/create-your-own-python-enviroment-locally-in-your-shared-hosting-account/



Install python packages on shared host
https://stackoverflow.com/questions/23428840/install-python-packages-on-shared-host


How to install python packages using pip on go daddy linux hosting (don't have root access)
https://stackoverflow.com/questions/45365604/how-to-install-python-packages-using-pip-on-go-daddy-linux-hosting-dont-have-r

'작업노트(호스팅)' 카테고리의 다른 글

호스팅 파이썬 설치모듈 확인  (0) 2018.08.23
호스팅 계정에 Python 3.6 설치  (0) 2018.08.22

username@server [~]# python
Python 2.4.3 (#1, Sep  3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> help('modules')

또는


$ pip list | grep 모듈명


현재 설치된 모듈을 표시한다.



개인 호스팅 디렉토리내에 모듈 설치

[server]$ pip install --target=$HOME/python275/lib requests


설치 후 실행모듈에서 package 디렉토리를 포함시킨다.


libpath = '/home/username/python275/lib'
sys.path.insert(0, libpath)





lib_pycurl_x86_64.tgz


아래 내용은 Python 3.6을 호스팅 계정에 설치합니다.

[server]$ cd ~
[server]$ mkdir tmp
[server]$ cd tmp
[server]$ wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
[server]$ tar zxvf Python-3.6.2.tgz
[server]$ cd Python-3.6.2
[server]$ ./configure --prefix=$HOME/python36
[server]$ make
[server]$ make install

./configure --prefix=$HOME/python36 --enable-optimizations 옵티마이저 옵션 사용시 10~20%정도 빠르다고 함. 하지만, 컴파일시 시간이 좀 더 걸림.



[server]$ cd ~
[server]$ vi ~/.bash_profile

export PATH=$HOME/python36/bin:$PATH

[server]$ source ~/.bash_profile
[server]$ which python3



호스팅 계정에서 PyCurl 사용하기 위해서는 pip install pycurl 설치 및 관련 curl library가 필요함.

x86_64 버전의 라이브러리를 파일로 첨부함.


1) pip install pycurl


2) LD_LIBRARY_PATH을 .bash_profile 에 추가

    LD_LIBRARY_PATH=/home/username/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH


3) library 파일을 계정아래 복사함.






+ Recent posts