環(huán)境:Windows10 Ubuntu16.04LTS子系統(tǒng)
安裝步驟:https://github.com/Cocos-BCX/Python-Middleware,
(python最低版本要求3.5,我這里安裝的是3.6版本)
安裝3.6版本python:https://blog.csdn.net/lzzyok/article/details/77413968
1、配置軟件倉庫,因?yàn)閜ython 3.6 新版沒有發(fā)布到ubuntu的正式倉庫中,咱們通過第3方倉庫來做。在命令行中輸入:
sudo add-apt-repository ppa:jonathonf/python-3.6
檢查系統(tǒng)軟件包并安裝 python 3.6
sudo apt-get update
sudo apt-get install python3.6
新安裝的3.6版本需要輸入 python3.6才能使用,那能不能配置我只輸入python3時(shí)就默認(rèn)使用3.6版本呢,當(dāng)然可以,執(zhí)行以下命令
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
sudo update-alternatives --config python3
安裝COCOSBCX PythonSDK之前需要手動(dòng)安裝setuptools,參考命令如下(https://www.cnblogs.com/6324TV/p/9063450.html):
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
tar -zxvf setuptools-19.6.tar.gz
cd setuptools-19.6
python3 setup.py build
python3 setup.py install
安裝pip:
https://www.cnblogs.com/6324TV/p/9063450.html
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb
tar -zxvf pip-8.0.2.tar.gz
cd pip-8.0.2
python3 setup.py build
python3 setup.py install
pip 更新:sudo pip install --upgrade pip
setuptools 安裝指定版本setuptools:sudo pip install "setuptools==41.1.0"
遇見Python.h: No such file or directory的解決方法
出現(xiàn)No such file or directory的錯(cuò)誤,有兩種情況,一種是沒有Python.h這個(gè)文件,一種是Python的版本不對,
可以進(jìn)入/usr/include/文件夾下的Pythonx.x文件夾里查找是否有Python.h這個(gè)文件。
如果是第一種情況,在根目錄根據(jù)Python版本如果是3.6版本那么需要安裝python-dev這個(gè)包,(sudo apt-get install python3.6-dev)。