como vincular o pip ao python3

1

Estou usando o Debian GNU / Linux 7.11 (wheezy), o python padrão é 2.7.3 e o pip é 1.1 (o qual atualizei para 9.x). Eu instalei o python 3.6 para executar alguns scripts, esse erro aparece,

Traceback (most recent call last):
  File "place_fixed2_debugged.py", line 2, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

então eu tentei pip install requests , e ele mostra que ele já está instalado, então eu tentei instalar o módulo de requisição manualmente, eu fiz o download de requests-2.18.4 e execute python3 setup.py , esse erro aparece,

File "setup.py", line 9, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'

Então eu tentei apt-get install python3-setuptools mostra também instalado python3-setuptools já está instalado também.

Eu acho que o problema aqui é que o pip e o apt estão instalando todos os pacotes relacionados ao python sob um caminho para o python2.7 padrão, ambos os módulos request e setuptool não estão vinculados ao python3.

Eu tentei o virtualenv, ele requer o módulo 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

Existe alguma outra maneira mais fácil de me permitir apenas vincular o pip ao python3.6? Eu realmente não quero configurar um virtualenv, obrigado!

    
por tomu 20.11.2017 / 10:05

1 resposta

1

Você precisa executar sudo apt install pip3

    
por 21.11.2017 / 00:52

Tags