# openssl 安裝(看情行使用,越新的Linux 應該不會做到這個) sudo apt-get install -y wget mkdir /tmp/openssl cd /tmp/openssl wget https://www.openssl.org/source/openssl-1.0.2q.tar.gz tar xvf openssl-1.0.2q.tar.gz cd /tmp/openssl/openssl-1.0.2q ./config make sudo make install sudo ln -sf /usr/local/ssl/bin/openssl `which openssl`
## 這邊可以登出再登入 openssl version 有沒有換掉
sudo pip3.7 install --upgrade pip
pip tls 問題
1 2 3 4 5 6 7 8 9 10 11 12
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting virtualenv Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/ Could not fetch URL https://pypi.org/simple/virtualenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/virtualenv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping Could not find a version that satisfies the requirement virtualenv (from versions: ) No matching distribution found for virtualenv pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
[安装python3.7时候,报错ModuleNotFoundError: No module named '_ctypes' - wang725的专栏 - CSDN博客](https://blog.csdn.net/wang725/article/details/79905612) or [python - Python3: ImportError: No module named '_ctypes' when using Value from module multiprocessing - Stack Overflow](https://stackoverflow.com/questions/27022373/python3-importerror-no-module-named-ctypes-when-using-value-from-module-mul)
Installing libffi-dev and re-installing python3.7 fixed the problem for me.
to cleanly build py 3.7 libffi-dev is required or else later stuff will fail
這邊感覺編譯失敗要重新清除編譯`sudo make clean` 由於這一塊我不熟,或者刪掉 python 資料夾重新跑
# ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8
# extra dependencies (over what buildpack-deps already includes) RUN apt-get update && apt-get install -y --no-install-recommends \ tk-dev \ uuid-dev \ wget \ gnupg \ && rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && apt-get install -y openssl zip unzip git libmcrypt-dev RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer RUN docker-php-ext-install opcache bcmath pdo_mysql mysqli
# ensure local python is preferred over distribution python ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8
# make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -s idle3 idle \ && ln -s pydoc3 pydoc \ && ln -s python3 python \ && ln -s python3-config python-config
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 19.3.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/ffe826207a010164265d9cc807978e3604d18ca0/get-pip.py ENV PYTHON_GET_PIP_SHA256 b86f36cc4345ae87bfd4f10ef6b2dbfa7a872fbff70608a1e43944d283fd0eee