Debian GNU / Linux 7.11 (wheezy)을 사용하고 있으며 기본 Python은 2.7.3이고 pip는 1.1입니다 (9.x로 업데이트했습니다). 일부 스크립트를 실행하기 위해 Python 3.6을 설치했는데이 오류가 나타납니다.
Traceback (most recent call last):
File "place_fixed2_debugged.py", line 2, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
그래서 시도했는데 pip install requests
이미 설치되어 있음을 보여 주었고 요청 모듈을 수동으로 설치하려고 시도했습니다. requests-2.18.4를 다운로드하고 실행 python3 setup.py
하면이 오류가 나타납니다.
File "setup.py", line 9, in <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
그런 다음 apt-get install python3-setuptools
설치된 python3-setuptools도 이미 설치되어 있음을 보여줍니다.
여기서 문제는 pip와 apt가 기본 python2.7에 대한 경로 링크 아래에 모든 Python 관련 패키지를 설치하고 있으며 요청 모듈과 setuptool이 모두 python3에 연결되어 있지 않다는 것입니다.
나는 virtualenv를 시도했지만 zlib 모듈이 필요 pip install zlib
합니다.
root@localhost:~/Python-3.6.0# pip install zlib
Collecting zlib
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement zlib (from versions: )
No matching distribution found for zlib
pip를 python3.6에 연결하는 다른 관리 가능한 방법이 있습니까? Virtualenv를 설정하고 싶지 않습니다. 감사합니다!
당신은 실행해야 sudo apt install pip3
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다