質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

1回答

11504閲覧

ローカル環境に入れたpip3が使えない。

teityura

総合スコア84

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

1クリップ

投稿2019/02/14 07:44

編集2019/02/14 08:08

ローカル環境にpython3.7を入れましたが、pip install ができません。
下記のようになってしまう状態です。

なお、yumでcurlやopensslのアップデートができず、自ユーザーだけで、
サーバーに影響を起こさずにインストールしなければならないこととします。

Dockerで、OSイメージから環境を構築しようと思いましたが、
インストール先がCentOS6.4であり、ローカル環境で入れる方法が分からず、
厳しそうに感じています。

pipを使えない原因と解消方法、
環境ごと構築する別の方法などございますでしょうか。

shell

1pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org beautifulsoup4 2pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 3Collecting beautifulsoup4 4 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/beautifulsoup4/ 5 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/beautifulsoup4/ 6 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/beautifulsoup4/ 7 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/beautifulsoup4/ 8 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/beautifulsoup4/ 9 Could not fetch URL https://pypi.org/simple/beautifulsoup4/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/beautifulsoup4/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping 10 Could not find a version that satisfies the requirement beautifulsoup4 (from versions: ) 11No matching distribution found for beautifulsoup4 12pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 13Could 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

下記を実行しても、同じエラーになりました。

pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org beautifulsoup4

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

t_obara

2019/02/14 09:12

別のネットワークに接続された環境から、ローカルのyumリポジトリ環境(DVDなど外部メディアに)を作成し、これを当該環境に持って来ることはできないのでしょうか。
teityura

2019/02/22 11:02

回答ありがとうございます。 そういう方法もあるんですね。 rpmで固めたりする方法もあるみたいで、 もっといろいろ調べてみます!
guest

回答1

0

自己解決

Python3.7以上はOpenSSL1.02以上を推奨しており、
OpenSSLが古いと動かない。

「Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381」

Python3.6なら、動きました。
Python3.7なら、別途考える必要がありそうです。

mkdir -p $HOME/src mkdir -p $HOME/local/python mkdir -p $HOME/bin mkdir -p $HOME/work/python3 cd $HOME/src wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz tar xvzf Python-3.6.0.tgz cd Python-3.6.0 ./configure --prefix=$HOME/local/python/ make make install cd $HOME/local/python/bin/ ./python3.6 --version ./pip3.6 --version ln -s $HOME/local/python/bin/python3.6 $HOME/bin/python3.6 ln -s $HOME/local/python/bin/pip3.6 $HOME/bin/pip3.6 vim ~/.bashrc alias py='python3.6' cd $HOME/work/python3 python3.6 -m venv test cd test/ . bin/activate pip freeze pip install --upgrade pip pip install beautifulsoup4 pip freeze

投稿2019/02/22 11:05

編集2019/02/22 11:07
teityura

総合スコア84

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問