前提・実現したいこと
さくらレンタルサーバのスタンダートプランにて、
サンプルプログラムのexampleに入っているchatプログラムを動かすことはそもそも可能なのでしょうか。
試したこと・その結果(エラーメッセージ)
sshでサーバに接続し、
%pip3 install gevent
しようとしましたが、失敗しました。
Collecting gevent Using cached gevent-1.2.2.tar.gz Requirement already satisfied: greenlet>=0.4.10 in ./local/python/lib/python3.6/site-packages (from gevent) Installing collected packages: gevent Running setup.py install for gevent ... error Complete output from command /home/domain/local/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/var/tmp/pip-build-pb4pp2a8/gevent/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-p9nupfbf-record/install-record.txt --single-version-externally-managed --compile: /home/domain/local/python/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'cffi_modules' warnings.warn(msg) (以下省略)
cffiがインストールされてないのが原因と考え、
%pip3 install cffiを行いましたが失敗しました。
Collecting cffi Using cached cffi-1.11.4.tar.gz Requirement already satisfied: pycparser in ./local/python/lib/python3.6/site-packages (from cffi) Installing collected packages: cffi Running setup.py install for cffi ... error Complete output from command /home/domain/local/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/var/tmp/pip-build-ermpvzi9/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-d_g93foq-record/install-record.txt --single-version-externally-managed --compile: Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing `libffi.pc' to the PKG_CONFIG_PATH environment variable Package 'libffi', required by 'world', not found (以下省略)
libffiが存在しないことが原因と考えlibffiを入れようとしましたが、
%pip3 install libffi も %pip3 install libffi-devel も、
could not find と言われてしまいました。
pipに対応していない(pythonではない)と考え%yumを使おうとしましたが、
yum: Command not found と言われてしまいました。
(yumは共用サーバ上では利用できないは?と考えました。)
pip以外の方法でインストールしようと、
まずwindows内にpipでインストールした後、
それをサーバの方のlibにコピー(環境設定等は行えていません)したうえで、
アクセスしてみましたが、エラー500が出ました。
(エラーログ一部抜粋) File "/home/domain/local/python/lib/python3.6/site-packages/gevent/core.py", line 12, in <module>: /home/domain/www/bottle-websocket/examples/chat/chat.cgi from gevent.libev import corecext as _core: /home/domain/www/bottle-websocket/examples/chat/chat.cgi ImportError: cannot import name 'corecext': /home/domain/www/bottle-websocket/examples/chat/chat.cgi (途中省略) File "/home/domain/local/python/lib/python3.6/site-packages/gevent/libev/corecffi.py", line 20, in <module>: /home/domain/www/bottle-websocket/examples/chat/chat.cgi import gevent.libev._corecffi as _corecffi # pylint:disable=no-name-in-module: /home/domain/www/bottle-websocket/examples/chat/chat.cgi ModuleNotFoundError: No module named 'gevent.libev._corecffi': /home/domain/www/bottle-websocket/examples/chat/chat.cgi
geventディレクトリ内のlibevディレクトリ内を見たところ、
corecext.pyxがありました。
調べるとこれはcythonというもので、
もしかして共用サーバではcythonは使用できないのでは・・?という考えに至りました。
(共用サーバでは事前コンパイルが必要な言語は使用できないと聞いた記憶があるので。)
(ちなみに%pip3 install Cythonはできています。)
諦めてVPSサーバを借りるしかないのでしょうか。
(予算的に厳しいのです・・。)
補足情報(FW/ツールのバージョンなど)
python3.6
pip9.0.1
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。