Unable to install pywinrm without upgrading and breaking pip - python

When trying to install the module via pip, it says I need to install setuptools 18.5 or higher. So I do a "pip install -U pip" it upgrades my pip version to 10.0.1. Then when I try to install the pywinrm module, it breaks with a Syntax Error.
In fact, it breaks all Pip commands when upgrading to 10.0.1. I have it currently installed with version 7.1.0 and Python 2.6.6
I try this:
pip install pywinrm
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python2.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
File "/usr/lib/python2.6/site-packages/pip/_internal/index.py", line 526
{str(c.version) for c in all_candidates},
^รข
SyntaxError: invalid syntax

Related

ImportError: Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module

Trying to integrate the Google firestore API in my python program
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/firebase_admin/firestore.py", line 22, in <module>
from google.cloud import firestore # pylint: disable=import-error,no-name-in-module
File "/home/pi/.local/lib/python3.7/site-packages/google/cloud/firestore/__init__.py", line 18, in <module>
from google.cloud.firestore_v1 import __version__
File "/home/pi/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/__init__.py", line 30, in <module>
from google.cloud.firestore_v1._helpers import GeoPoint
File "/home/pi/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/_helpers.py", line 22, in <module>
from google.api_core import gapic_v1
File "/home/pi/.local/lib/python3.7/site-packages/google/api_core/gapic_v1/__init__.py", line 16, in <module>
from google.api_core.gapic_v1 import config
File "/home/pi/.local/lib/python3.7/site-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
import grpc
File "/usr/local/lib/python3.7/dist-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/usr/local/lib/python3.7/dist-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/python3.7/dist-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/Code/main.py", line 10, in <module>
from firebase_admin import firestore
File "/home/pi/.local/lib/python3.7/site-packages/firebase_admin/firestore.py", line 28, in <module>
raise ImportError('Failed to import the Cloud Firestore library for Python. Make sure '
ImportError: Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module.
I have this error and have tried every option I have found
I installed the firebase-admin module:
pip3 insstall --upgrade -t libs firebase-admin
I installed grpc:
pip3 install grpcio
I installed google-cloud-core and google-cloud-firestore:
pip3 install google-cloud-core
pip3 install google-cloud-firestore
I even tried uninstalling and reinstalling all of these modules. But nothing seems to be working. Any advice would be appreciated.
Generally, it advised to install packages using python -m command instead of simply pip or pip3.
Try installing as follows:
python3.7 -m pip install google-cloud-firestore
Additionally, I would recommend using a virtual environment.
# Create a virtual environment using Python3.7
$ python3.7 -m venv env
# Activate the virtual environment
$ source env/bin/activate
# Install dependencies
(env) $ python3.7 -m pip install google-cloud-firestore

pip: sys.stderr.write(f"ERROR: {exc}") with Python 3.5 [duplicate]

This question already has answers here:
Installing pip is not working in python < 3.6
(6 answers)
Closed 2 years ago.
i am having a trouble with pip and pip3.
I am trying to install requirements and it shows an error. When i write pip3 or pip --version it show this error.
jumphost#jumphost-VirtualBox:~$ pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import __main__
File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line
21, in <module>
from pip._internal.cli.main import main as _main
File
"/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
If i am trying to install, it showed this
jumphost#jumphost-VirtualBox:~/kubespray$ pip install -r requirements.txt
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import __main__
File
"/usr/local/lib/python2.7/dist-packages/pip-21.0-py2.7.egg/pip/__main__.py",
line 21, in <module>
from pip._internal.cli.main import main as _main
File
"/usr/local/lib/python2.7/dist-packages/pip-21.0-py2.7.egg/pip/_internal/cli/main.py",
line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
jumphost#jumphost-VirtualBox:~/kubespray$ pip3 install -r requirements.txt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import __main__
File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line
21, in <module>
from pip._internal.cli.main import main as _main
File
"/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
I didn't found a right answer so this is the reason why i ask you. Thanks !
I tried remove python, pip, python3 and pip3 multipletimes but still same problem.
pip has dropped support for Python 2 and 3.5. You will need to use a version-specific branch, assuming that your Python version is 3.5:
curl -fsSL https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5
get-pip.py reference: https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py
Related: How can I install a legacy PIP version with python 2.6.6 or python 2.7.5?
Better yet, as suggested in the comments, install a newer version of Python that is not end-of-life.

msys2/mingw64: pip: VC 6.0 is not supported by this module

I try to install a package in Windows 10 (mingw64) and get this error:
IEUser#MSEDGEWIN10 MINGW64 /c/Users/IEUser/PycharmProjects/myapp_msi-msys/myapp_msi
$ pip install -e git+https://source.example.lan:40443/repos/myapp_common#egg=myapp_common
Obtaining myapp_common from git+https://source.example.lan:40443/repos/myapp_common#egg=myapp_common
Cloning https://source.example.lan:40443/repos/myapp_common to c:/users/ieuser/pycharmprojects/myapp_msi-msys/myapp_msi/src/myapp-common
Username for 'https://source.example.lan:40443':
Password for 'https://tguettler#source.example.lan:40443':
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/__init__.py", line 191, in <module>
monkey.patch_all()
File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 101, in patch_all
patch_for_msvc_specialized_compiler()
File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 164, in patch_for_msvc_specialized_compiler
patch_func(*msvc9('find_vcvarsall'))
File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 151, in patch_params
mod = import_module(mod_name)
File "C:/msys64/mingw64/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "C:/msys64/mingw64/lib/python2.7/distutils/msvc9compiler.py", line 306, in <module>
raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
What can I do to fix this?
I was following these instructions to set up my development environment: https://www.gtk.org/download/windows.php
Update
Just for the records, I switched from gtk to qt (PySide2) and now I can use the default Python for windows. Everything is much easier now.
In MSYS2, many of the issues are patched downstream with the MINGW-packages that go in to the pacman repository. In this case, the reason you are getting this error is that you have setuptools pip installed, instead of installed using the pacman repository. To fix this issue:
pip uninstall setuptools
pacman -S mingw-w64-x86_64-python-setuptools
or if you are using modern Python:
pip3 uninstall setuptools
pacman -S mingw-w64-x86_x64-python3-setuptools

Using Pip and Importing Packages in Python 3 on Ubuntu

I'm on Lubuntu (a minimal build of Ubuntu). I installed Python 3.6.1 with:
sudo apt-get install python3.6
I want to use Twilio, so I tried this:
pip install twilio
It said pip wasn't recognized, so I ran this, followed by the above again:
sudo apt install python-pip
I fired up Python 3.6 and tried importing it, but that didn't work out:
>>> from twilio.rest import Client
ModuleNotFoundError: No module named 'twilio'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
I'm new to python3 (which I want to use for the secrets module), Ubuntu, and twilio, so I'm not really sure what's going on here. I'd think if it was as simple as a module not being found, the stack trace would be much shorter... I'm not sure if the stack trace is so long because maybe Python 3 produces longer ones than 2 did, or Ubuntu is trying to do something weird because both Python 2 and 3 are installed (and perhaps two versions of 3 at that), or if maybe this is the work of twilio?
Try the following to download pip:
wget https://bootstrap.pypa.io/get-pip.py
Then install pip by running:
sudo python3 get-pip.py
Then you can install twilio with pip
sudo pip3 install twilio

pip Not Working Python 2.7

I am having a problem with pip just now, when I try to install something like pip install readline then I get an error:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 549, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2709, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2369, in load
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2375, in resolve
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
So I ran cat /usr/local/bin/pip which tells me pip==1.5.6. I tried to find a solution online regarding this and one solution told to cd /usr/local/lib/python2.7/site-packages && ls but for me I see that folder is also empty.
If upgrading pip doesn't work, you should try uninstalling it and reinstalling it. The error you're encountering is likely due to a mismatch in versions between pip and requests. First, I would remove pip and reinstall it from the source with python like this:
sudo apt-get remove python-pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
From the Ubuntu launchpad site
Just check If You have installed python-setuptools rpm, If this is installed You can use easy_install pip on Redhat Based System.
I would comment this but due to low reputation I can't. Did you try upgrading pip?
pip install --upgrade pip
And then try to do that again.
If you are using Debian flavor OS (like Ubuntu) try this
apt-get remove python-pip
Then try to install the latest version by easy_install
easy_install pip

Categories