pip3 install firebase-admin fails at Command "python setup.py egg_info" failed with error code 1 - raspberry-pi

I'm trying to install firebase-admin on a Raspberry Pi. I have 3 cards with fresh Debian 10 (buster) (i.e. fully updated/upgraded), and tried 3 different ways to get firebase-admin to install (I know it can be done since I did it on another Raspberry Pi, but did so many things before I finally got it to install, that I can't reproduce what I did!). So in each attempt to install firebase-admin, I get the "python setup.py egg_info" failed with error code 1"
Here is what I did on 2 fresh cards in the RPi:
export PATH="/home/pi/.local/bin:$PATH"
python3 -m pip install google-cloud-storage (successful)
python3 -m pip install firebase (successful)
python3 -m pip install firebase_admin ---> fails with error shown above
I then tried sudo in front of the python3 commands above, with the same result. Finally, on one of the non-sudo cards, I did a "python3 -m pip install --upgrade pip setuptools wheel" (successful), and then repeated step 4 above with the same result (i.e. python setup.py egg_info" failed with error code 1).
I am desperate (and doing something really basic and stupid?) .... any help would be much appreciated! Thanks (I have tried all suggestions in questions similar to this one, without success).

Using a raspberry-pi zero W, almost identical problem. firebase works fine, firebase_admin fails with:
python setup.py egg_info did not run successfully. │ exit code: 1
It seems to work if you install the firebase admin package with an older version of grpcio. This is the command I used.
pip install firebase-admin "grpcio <= 1.40.0"
I don't know if it's necessary, but I had that specific version of grpcio already installed manually, from a previous attempt to fix the issue:
pip3 install --no-cache-dir --force-reinstall -Iv grpcio==1.40.0
Hope it helps!

Related

How to install egg file with easy_install?

On a HPC node, I have a file named pysdf-0.1-py3.8-linux-x86_64.egg.
I found a Nvidia Manual to install this file using python -m easy_install pysdf-0.1-py3.8-linux-x86_64.egg.
However, when I run this command I get the following error.
(/scratch/s.1915438/modulus) [s.1915438#sl1 eggs]$ python -m easy_install pysdf-0.1-py3.8-linux-x86_64.egg
/scratch/s.1915438/modulus/bin/python: No module named easy_install
Similarly, if I use pip install as follows
(/scratch/s.1915438/modulus) [s.1915438#sl1 eggs]$ python -m pip install pysdf-0.1-py3.8-linux-x86_64.egg
ERROR: Could not find a version that satisfies the requirement pysdf-0.1-py3.8-linux-x86_64.egg (from versions: none)
ERROR: No matching distribution found for pysdf-0.1-py3.8-linux-x86_64.egg
I do not have admin access on HPC server to use sudo apt. My python is installed at /scratch/s.1915438/modulus/bin/python on the HPC machine.
Does anyone knows why it says Could not find a version that satisfies the requirement.
After 3 months, I figured out how to do this. So, egg files can be installed using something called easy_install which was depreciated back in 2019. The last version of setuptools that supported easy_install was setuptools 42.0.0..
So, you need to downgrade to that version as follows.
pip3 install setuptools==42.0.0
And then install the egg files using the following command.
python3 -m easy_install example.egg
If you wish to upgrade the setuptools to the latest version, then type
pip3 install setuptools --upgrade

python2.7 in Raspbian Lite

I have installed Raspbian Lite OS in Raspberry Pi zero.
I found that Raspbian Lite comes with Python3 as default.
But I am gonna run some scripts that uses libraries that are Python2 Compatible.
So I tried to change the default Python version from Python3 to Python2 (Specifically Python2.7.18)
After so much searching and trying, instructions from [this page][1] made my job
Now if I try to check in command writing
python --version
It shows me that it is Python2.7.18
But the problem is I am not being able to install any packages using
sudo apt-get install <python-packagename>
It shows me Errors like
1.Package "python-pip" has no installation candidate (When I tried to install pip)
2. Package python-numpy has no installation candidate (when I tried to install numpy)
3. unable to locate package python-pyaudio (when I tried to install pyaudio)
I am searching but no solution.
Can anyone please help? I am frozen in a critical stage of my project .
Generally, for new raspbian/raspios os with python 3 by default, it is not suggested to replace the system python interpreter to python 2, it may break some system component's dependency.
Instead, you can create a python 2 virtual env, if you need to run python2 scripts.
sudo apt-get install python3-pip
pip install virtualenv
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
You can test the python version as following,
(venv) $ python --version

Unable to create virtual environment on CentOS 7.8 and python3.6

I have two servers that are running CentOS 7.8 with all the latest patches as of the date of this post. On one server I can create a venv, and on the other I get an error. Here is the command used to create the venv:
python3.6 -m venv venv
The error is:
Error: Command '['/root/venv/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
So it seems there is a problem after the venv is created. In fact, it makes the links to the python interpreters in venv/bin, but the lib64/python3.6 and lib/python3.6 directories that are created have only empty site-packages in them. I get the problem whether running the command with root privileges (as above) or as a non-privileged user. On the other system, which is not quite the same hardware but very similar, I get no errors.
I have tried a bunch of things including completely uninstalling all the python3 rpms and reinstalling them on both systems. The python3 modules installed are:
python3, python3-devel, python3-libs, python3-other-rpm-macros, python3-pip, python3-rpm-generators, python3-setuptools, python3-tkinter, python3-wheel. All these are installed using the centos repos.
I have searched the internet and one thing that works is to use --no-pip. However, not surprisingly, if I do that I get a venv with no pip, which does not work very well. The version of pip that is installed with the rpm is version 9.0.3. However, I have tried upgrading pip:
python3.6 -m pip install --upgrade pip
This installs pip 20.1. Interestingly, it is installed in /usr/local/lib/python/site-packages. In any event, it doesn't change anything and I get essentially the same error message.
I have even gone as far as rsyncing the /usr/lib/python3.6 and /usr/lib64/python3.6 (using -avu --delete) on the two servers so that they are identical. All to no avail. I am at a loss to know what to do.
I can of course hack things to make them work, but since I am using this to automatically build test environments I really need to get it working automatically. Suggestions would be greatly appreciated.
I've had the same issue on CentOS Linux release 7.9.2009 (Core) and solved it by installing the following system packages:
yum install python36-devel
yum install python36-setuptools
yum install python36-virtualenv
python3.6 -m pip install --upgrade pip
Used virtualenv to install the venv into the project-root:
python3 -m virtualenv venv-dev
After sourcing the venv everything looks good and I could install the needed requirements:
. ./venv-dev/bin/activate
python3 --version
Python 3.6.8
pip3 --version
pip 21.1.1 from /project/root/dir/venv-dev/lib/python3.6/site-packages/pip (python 3.6)
pip3 install -r requirements/dev.txt
Successfully installed ...

Issue while installing Scipy

I installed Scipy using the command sudo apt-get install python-numpy python-scipy and looks like the latest version of both are installed. But when I try to install a python package named wfdb using pip install wfdb, it get an error while Building wheel for scipy (PEP 517).
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-
fhfmfpqi/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-
fhfmfpqi/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__,
'"'"'exec'"'"'))' clean --all
cwd: /tmp/pip-install-fhfmfpqi/scipy
Complete output (9 lines):
`setup.py clean` is not supported, use one of the following instead:
- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
files that aren't checked into the git repo)
Add `--force` to your command to use it anyway if you must (unsupported).
----------------------------------------
ERROR: Failed cleaning build dir for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly`
I upgraded pip using pip install --upgrade pip.
python version used: 3.7
Can I get some help on this?
Clean out the install (I don't know which system you're using) i.e. get rid of the $PATH variables and just do a fresh install.
If you're using Anaconda:
conda install -c anaconda scipy
should do it
also the goops old
pip install scipy
gets it done as well. May I ask why you approached your installation in this way (again, I don't know which system you're on)
Never do sudo pip. Instead do pip install --user. Or (better) work in a virtualenv.
EDIT: typo: there is no space between -- and user.

egg_info errors installing ipython

I'm having issues installing ipython with sudo pip install "ipython[notebook]".
The error that I am seeing is
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Jzcy1W/terminado
Any ideas on how I can resolve this?
In this case the issue seemed to be that setuptools was outdated. By updating setuptools pip install "ipython[notebook]" went through flawlessly and I am able to work in the interactive shell nicely.
Thanks to all that helped track this down.
egg_info errors installing ipython in windows
Right. I also faced this problem and later I updated setuptools and went for installing ipython.
To update setuptools run windows command and type :
python -m pip install --upgrade setuptools
Then, install ipython using pip:
pip install ipython
I am using python in windows and newbie. So your experienced problem
and solution might be helpful for me and others. Thanks!