Use Python external module on Sakura Internet

Sakura I want to run external modules when I can run Python on the Internet. So I thought I'd write all the work I did. There may be some work that you don't need, but I don't know. It feels like I've done everything I can think of.

Add the following to .cshrc in your home directory

setenv PYTHONPATH ~/lib/python

Log in with SSH,

% mkdir -p ~/.local/lib/python2.7

For the module you want to install, create tmp directly under www and put it in it. Let's insuko Requests-OAuthlib as an example.

% cd www
% cd tmp
% cd requests-oauthlib-master
% python setup.py install --user

So, write a spell in the header of the Python script itself that runs on CGI.

#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import sys, codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
from requests_oauthlib import OAuth1Session
import json
import cgi

print "Content-Type: text/html\n"

Now you can create a Twitter client on Sakura's rental server. Congratulations ...

But the bottle still doesn't work ...

Recommended Posts

Use Python external module on Sakura Internet
Sakura Use Python on the Internet
Use matplotlib on Ubuntu 12 & Python
Use Python on Windows (PyCharm)
Print PDF in Python on Windows: Use an external application
Install Python3 on Sakura server (FreeBSD)
Use blender as a python module
Python 2.7, 3.4, 3.5 extension module build environment on Windows
python3 How to install an external module
Memorandum on how to use gremlin python
Use without installing python 2.x on Windows
Use external modules on Google App Engine
Install python on xserver to use pip
Use Django's ImageField on App Engine / Python
How to use TouchDesigner Python's external module
Python module import
Python on Windows
twitter on python3
How to use Python Kivy ④ ~ Execution on Android ~
[Python of Hikari-] Chapter 08-04 Module (Installation of external library)
Use cryptography module to handle OpenSSL in Python
python on mac
Python on Windbg
Until you use PhantomJS with Python on Heroku
Python collections module
Building a Python environment on a Sakura VPS server
Use the nghttp2 Python module from Homebrew from pyenv's Python
use go module
About Python external module import <For super beginners>
Include and use external Kv files in Python Kivy
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
How to use Django on Google App Engine / Python
Beginners use Python for web scraping (4) --2 Scraping on Cloud Shell
Use thingsspeak from python
Python conda on cygwin
Install python on WSL
Use config.ini in Python
Python module (Python learning memo ④)
PyOpenGL setup on Python 3
[Python] Use JSON with Python
Use fluentd from python
Install Python on Pidora.
Install Scrapy on python3
Create a Python module
python original module import
Use Valgrind in Python
Use MySQL from Python
Use mecab with Python3
Install Python on Mac
Use LiquidTap Python Client ③
Until you use Python 3 system on Sakura rental server (create verification environment) Part 1 Contract-Initial setting
Install python external library
Installing pandas on python2.6
Using Python #external packages
Use Python 3.8 with Anaconda
python basic on windows ②
Install python on windows
Use python with docker
Use LiquidTap Python Client ②
Install Python 2.7.3 on CentOS 5.4
Use BigQuery from python.