# raspberry 3b+ firebase

#### melili

Joined Mar 31, 2021
17
Hello, I am using Raspberry Pi 3B +. For my graduation project, I have to collect the data in firebas and display it in android, but I get an error like this. I would be very happy if you could help. This project is very important to me.

PYTHON 3.7.3

from .async import process_pool
^
SyntaxError: invalid syntax

#### Yaakov

Joined Jan 27, 2019
2,861
That's a syntax error. An error in your code. There's no way to help without seeing the code.

#### melili

Joined Mar 31, 2021
17
That's a syntax error. An error in your code. There's no way to help without seeing the code.

#### melili

Joined Mar 31, 2021
17
That's a syntax error. An error in your code. There's no way to help without seeing the code.

#### Yaakov

Joined Jan 27, 2019
2,861
The problem is in the distribution of firebase. If you install the latest version, it's fixed:

Code:
pip install git+https://github.com/ozgur/python-firebase
That's a command line.

#### melili

Joined Mar 31, 2021
17
The problem is in the distribution of firebase. If you install the latest version, it's fixed:

Code:
pip install git+https://github.com/ozgur/python-firebase
That's a command line.
I wrote this code on the command line, but the same error continues.

#### Yaakov

Joined Jan 27, 2019
2,861
I wrote this code on the command line, but the same error continues.
Did the new version install?

#### melili

Joined Mar 31, 2021
17

#### Yaakov

Joined Jan 27, 2019
2,861
The problem is a conflict in some versions of firebase because "async" is a reserved keyword in Python itself.
I'm not sure, but you might have more than one version of Python installed. That installed for 2.7, are you using 3.x for your program?

#### Yaakov

Joined Jan 27, 2019
2,861

#### MrSalts

Joined Apr 2, 2020
235
from .multiprocess_pool import process_pool

Then rename your file in the firebase library from
/usr/local/lib/python3.7/dist-packages/firebase/async.py
To
/usr/local/lib/python3.7/dist-packages/firebase/multiprocess_pool.py

Or, revert to Python 3.6 where async is not a keyword.

#### melili

Joined Mar 31, 2021
17
from .multiprocess_pool import process_pool

Then rename your file in the firebase library from
/usr/local/lib/python3.7/dist-packages/firebase/async.py
To
/usr/local/lib/python3.7/dist-packages/firebase/multiprocess_pool.py

Or, revert to Python 3.6 where async is not a keyword.
How can I activate a different version in raspberry pi. I have 2.7.16. Because I couldn't change the file names.

#### melili

Joined Mar 31, 2021
17
The problem is a conflict in some versions of firebase because "async" is a reserved keyword in Python itself.
I'm not sure, but you might have more than one version of Python installed. That installed for 2.7, are you using 3.x for your program?
Yes I am using 2.7.16. But the text editor shows 3.7.3 how can I change it. But both are loaded.

#### melili

Joined Mar 31, 2021
17
The problem is a conflict in some versions of firebase because "async" is a reserved keyword in Python itself.
I'm not sure, but you might have more than one version of Python installed. That installed for 2.7, are you using 3.x for your program?

#### melili

Joined Mar 31, 2021
17
from .multiprocess_pool import process_pool

Then rename your file in the firebase library from
/usr/local/lib/python3.7/dist-packages/firebase/async.py
To
/usr/local/lib/python3.7/dist-packages/firebase/multiprocess_pool.py

Or, revert to Python 3.6 where async is not a keyword.
I noticed that python scripts work wonderfully in the IDE, but fail when run from a terminal window.

Further examination disclosed that the version of python used with the IDE, (Thonny), is 3.7.3, but the version used by the terminal is 2.7.16.

I would have thought that both the IDE and the terminal would automagically use the same version, but apparently this is not true.

1. Why is this so?
2. Obviously python 3.7.3 is installed on this latest (?) How can I fix this because firebase doesn't work in this version.

#### MrSalts

Joined Apr 2, 2020
235
Use the command
sudo mv oldFileName.py newFileName.py

The operating system may ask for your RPi password before executing the command - default is: raspberry (unless you changed it.

it is not letting you change the password without the “sudo” (super user do) prefix because the file is not in your home path. This is a security of Linux so you think twice before you do something that could cause problems with the operating system.

#### melili

Joined Mar 31, 2021
17
Use the command
sudo mv oldFileName.py newFileName.py

The operating system may ask for your RPi password before executing the command - default is: raspberry (unless you changed it.

it is not letting you change the password without the “sudo” (super user do) prefix because the file is not in your home path. This is a security of Linux so you think twice before you do something that could cause problems with the operating system.

mv: Could not state 'async.py': There is no such file or directory

Thanks a lot for your answer but I got an error like this. How can I fix this?

I wrote that

sudo mv async.py nasync.py

#### MrSalts

Joined Apr 2, 2020
235
You have to be in the working directory where async.py is located before entering the command,
Or,
You have to use the full file path for old and new file name

#### MrSalts

Joined Apr 2, 2020
235
A single command, all on one line as...
Code:
sudo mv  /usr/local/lib/python3.7/dist-packages/firebase/async.py  /usr/local/lib/python3.7/dist-packages/firebase/multiprocess_pool.py
or,

Code:
cd  /usr/local/lib/python3.7/dist-packages/firebase/
sudo mv async.py  multiprocess_pool.py

#### melili

Joined Mar 31, 2021
17
A single command, all on one line as...
Code:
sudo mv  /usr/local/lib/python3.7/dist-packages/firebase/async.py  /usr/local/lib/python3.7/dist-packages/firebase/multiprocess_pool.py
or,

Code:
cd  /usr/local/lib/python3.7/dist-packages/firebase/
sudo mv async.py  multiprocess_pool.py

Thank you very much, I was able to change the file name to the code you suggested. But I also need to make changes in the command line here. How can I do this?