gsutil says it cannot find python - google-cloud-platform

I installed the cloud SDK. The path variable is updated to the location of the sdk
I have python 2.7 and python 3.8 installed on the machine. Python 2.7 is installed at
C;\Python27\python.exe
Now when I run the gsutil I get an error
C:\Windows\system32>gsutil
ERROR: (gsutil) "C:\Python27\python.exe": command not found

Related

pypy2.7.1.1 fails using pyenv

I am trying to install python version pypy2.7.1.1 using the following
pyenv install pypy2.7-7.1.1
I get the following error:
Downloading pypy2.7-v7.1.1-osx64.tar.bz2...
-> https://downloads.python.org/pypy/pypy2.7-v7.1.1-osx64.tar.bz2
Installing pypy2.7-v7.1.1-osx64...
Installing pip from https://bootstrap.pypa.io/get-pip.py...
error: failed to install pip via get-pip.py
BUILD FAILED (OS X 11.2.3 using 0000000000)
Inspect or clean up the working tree at /var/folders/zt/q3p12vyx3l990yc32wmybqdr0000gs/T/python-build.20210428193745.1720
Results logged to /var/folders/zt/q3p12vyx3l990yc32wmybqdr0000gs/T/python-build.20210428193745.1720.log
Last 10 log lines:
/var/folders/zt/q3p12vyx3l990yc32wmybqdr0000gs/T/python-build.20210428193745.1720 ~
/var/folders/zt/q3p12vyx3l990yc32wmybqdr0000gs/T/python-build.20210428193745.1720/pypy2.7-v7.1.1-osx64 /var/folders/zt/q3p12vyx3l990yc32wmybqdr0000gs/T/python-build.20210428193745.1720 ~
ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.
since pip was moved for 2.7 how do I install this now? is there a different way to install deprecated versions of python now?
I was having a similar issue on Mac OS 10.15.7 (Catalina).
This is how I was finally able to install Python 2.7 via pyenv
export GET_PIP_URL=https://bootstrap.pypa.io/pip/2.7/get-pip.py
PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA=openssl#1.0 pyenv install 2.7.5
I realize that you are trying to install pypy and not Python, but hopefully the method above helps you, or others!

Google Cloud SDK fails to install on Windows 10

Having Python27 installed on a Windows 10 I'm failing to install Google's Cloud SDK.
Its install fails with:
ImportError: cannot import name _remove_dead_weakref
Failed to install.
On its way to this failure it suggests:
Please verify that the following is the path to a working Python 2.7 executable:
C:\Users\c\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe
If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 executable.
A working Python 2.7 is indeed in the desired place. Setting CLOUDSDK_PYTHON doesn't fix its problem
I removed the environment variable PYTHONHOME and the Google Cloud SDK installed successfully.

I have installed python 3.6 but ubuntu still gives python 2.7 when checked for the version. How do I switch to 3.6?

I have successfully installed the latest Python version 3.6 but when checked for the present version of python using "python -V" command it gives Python 2.7 as output. How can I switch to Python 3.6?
add an alias to .bash_rc and .bash_profile in your home directory after other alias lines near the bottom and the export PATH line respectively as follows:
alias python='/usr/bin/python3.6'
This will direct your profile to use python 3.6 in this example everytime you use python and no need to specify python3. It will not correct the ansible default path however which I am still searching for an answer on how to change that from python2.7 to python3.6.

HTML5LIB installation problems

I have a Win 7 machine with Python 2.7 instlled and 3.5
2.7 is in C:\Python27
3.5 is in C:\Users\xxx\AppData\Local\Programs\Python\Python35-32
I want to use html5lib import with my Python 2.7 installation
I can see its installed in the 3.5 directory
How do I installed it so its available for the 2.7 installation?
My path is
C:\Users\xxx\AppData\Local\Programs\Python\Python35-32\Scripts\;
C:\Users\xxx\AppData\Local\Programs\Python\Python35-32\;
C:\Program Files (x86)\Nmap;
C:\Users\xxx\AppData\Roaming\npm
Thanks for reading
In the end I ran the pop command using the full path for the directory when python 2.7 was installed.
Job jobbed!!!

Scrappy Installation and Command Line

I have both Python 2.7 and 3.4 versions installed on my MacOS. And i downloaded scrapy with pip as suggested.
$pip install scrapy
It automatically installed required packages into 3.4 directory. Than i realized that scrappy is not supporting Python3 currently. So i decided to change the installation directory and reinstalled scrapy with below command which is for Python2 spesific packages
$python2 -m pip install scrapy
After executing this command, scrapy is succesfully installed on my 2.7 directory. But whenever i try to execute a scrapy command it still refers to the version located at Python3/bin so it is not working.
As a workaround im using full path of the scrapy executable in Python2 directory and its working now.
How can i change the default option for scrapy command or any other commands so that the commandline understands which directory im talking about whether it is located on 2.7/bin or 3.4/bin directory.
EDIT : I uninstalled scrapy in python3 directory using $pip3 uninstall scrapy but still gives me below error when i type scrapy
-bash: /Library/Frameworks/Python.framework/Versions/3.4/bin/scrapy: No such file or directory
Thanks in advance