I wrote a very simple script (Python) to load data from Google Firebase. For this I downloaded firebase with sudo pip install python-firebase on my Raspberry. But when I start my script, I get this message:
Traceback (most recent call last):
File"...", line 2, in <module>
from firebase import firebase
File"/usr/local/python3.7/dist-packages/firebase/__init__.py", line 3
from .async import process_pool
SyntaxError: invalid syntax
The script I wrote is certainly not the problem, because I got it from the Internet and there I found the same code on different pages.
I have researched on the Internet, but can not find a real solution to this problem. I read on one page that it MAY be related to the Python version(3.7.3)... Is that possible in your view? Did I forget anything else to download (I only downloaded firebase as I mentioned above)? Does anyone know the solution or had the same problem?
Thanks in advance
Related
I'm running yt-dlp in an iOS App, and 2 days ago they just fixed it because of a YouTube code change:
https://github.com/yt-dlp/yt-dlp/issues/6247
The problem is that I already updated from the yt-dlp library file from the new releases:
https://github.com/yt-dlp/yt-dlp/releases
And I'm getting exactly the same error:
Anything that I'm missing?
Thanks for your help!
Can't seem to install the Cassandra package, marathon get's stuck in deployment in phase 1/2 and dcos cassandra subcommand issues the following stacktrace, any help appreciated.
Traceback (most recent call last):
File "/home/azureuser/.dcos/subcommands/cassandra/env/bin/dcos-cassandra", line 5, in <module>
from pkg_resources import load_entry_point
File "/opt/mesosphere/lib/python3.4/site-packages/pkg_resources.py", line 2701, in <module>
parse_requirements(__requires__), Environment()
File "/opt/mesosphere/lib/python3.4/site-packages/pkg_resources.py", line 572, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests
Python version: Python 3.4.2
requests version : 1.8.1
I'm on the team that's building the Cassandra service. Thanks for trying it out!
We've just updated the Cassandra CLI package to better define its pip dependencies. In your case it looks like it was trying to reuse an old version of the requests library? To kick your CLI's Cassandra module to the latest version, try running dcos package uninstall --cli cassandra; dcos package install --cli cassandra. Note that the --cli is important; omitting it can result in uninstalling the Cassandra service itself, while all we want is to reinstall the local CLI module.
Keep in mind that you should also be able to access the Cassandra service directly over HTTP. The CLI module is effectively a thin interface around the service's HTTP API. For example, curl -H "Authorization:token=$(dcos config show core.dcos_acs_token)" http://<your-dcos-host>/service/cassandra/v1/plan | jq '.'. See the curl examples in the Cassandra 1.7 docs for other endpoints.
Once you've gotten the CLI up and running, that should give more insight into the state of the service, but logs may give more thorough information, particularly if the service is failing to start. You can access the service logs directly by visiting the dashboard at http://<your-dcos-host>/:
Click Services on the left, then select marathon from the list. The Cassandra service manager is run as a Marathon task.
A panel will come up showing a list of all tasks being managed by Marathon. Click cassandra on this list to show its working directory, including the available log files.
When hovering over files, a magnifying glass will appear. Click a magnifying glass to display the corresponding file in-line.
Unfortunately we're still having the same problem, though we've managed to get a workaround. It seems there are more than one distinct issues with DC/OS on Azure, anyway I'll provide further feedback. If using the Marketplace version of DC/OS 1.7.0, Cassandra doesn't deploy, it get's stuck in Marathon on phase 1/2, upon inspection of the logs it seems to have a problem with accessing the default ports.
Pastebin to log file
On the other hand that problem doesn't appear on ACS DC/OS, Cassandra deploys correctly appearing in the DC/OS Service tab as well as on Marathon. The DCOS Cassandra CLI doesn't work on any. Upon a not very thorough inspection, it seems that when we installed DCOS CLI using the method above there are some issues with the dependencies specially taking into account the $PYTHONPATH variable
/opt/mesosphere/lib/python3.4/site-packages
We were able to solve the dependencies issue by taking two actions:
First Dependency issue was with requests module, which was solved with the following actions after installing cli for the Cassandra subcommand.
cd ~/.dcos/subcommands/cassandra
source env/bin/activate
pip install -Iv requests
We used -Iv since the usual update procedure fails with external dependency in $PYTHONPATH path, so requests dependency solved.
Second dependency which the cassandra subcommand was requiring was docopt, again by using the same method we were able to solve the issue and now the subcommand works as per the documentation
pip install -Iv docopt
This does seem a bit hackish, wondering if there's anything more appropriate to be done.
output of dcos cassandra connection after taking above steps
{
"address": [
"10.32.0.9:9042",
"10.32.0.6:9042",
"10.32.0.8:9042"
],
"dns": [
"node-0.cassandra.mesos:9042",
"node-1.cassandra.mesos:9042",
"node-2.cassandra.mesos:9042"
]
}
The same happens for other DC/OS subcommands like for example the Kafka one.
I've deployed a Rails application on Heroku. I also have a Python script inside the Rails bin folder. I am now using Heroku scheduler to run the Python script every 10 minutes. I want to test it first. So I run:
heroku run python bin/notify.py
in my local terminal. Then I got the following error message:
Running python bin/notify.py on ...
Traceback (most recent call last):
File "bin/notify.py", line 6, in <module>
import sendgrid
ImportError: No module named sendgrid
However, I've already had the sendgrid addon on Heroku. I can also use sendgrid in my Rails code without any problem.
Can anyone help me with this? Thanks!
Sounds like you forgot to install Python's sendgrid dependency when building the container. See declare Python app dependencies for how to install Python dependencies. As you are running both, ruby and Python, you have to install both buildpacks to ensure both dependencies are being loaded.
I contacted Heroku tech support. They told me I have to install both the ruby and python buildpack and include sendgrid in the requirements.txt in the application root directory.
https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app
Issue resolved.
I am following getting started guide of google app engine python2.7. I have downloaded zip file of app engine for my ubuntu. I have created helloworld files and ran
'google_appengine/dev_appserver.py helloworld/'
command. localhost:8000, i.e. admin page opens fine, but localhost:8080 has server error.
I have tried to import in my local python environment, which gave an error. So do we have to install it? which I tried according to webapp2's official website but didn't work out.
This question gets asked so many times, have you checked stackoverflow for similar answers?
Have you read the documentation on what third party libraries are included with the appengine runtime.
webapp2 is included in the runtime but you must configure support/inclusion in app.yaml
https://developers.google.com/appengine/docs/python/tools/libraries27
And before you get any further read up on how to include external third party libraries. You will save yourself lots of time and questions just reading.
I am just starting to use Python GAE in Windows 7.
Based on my observations, it seems like changes that I make to the python scripts in my
local app engine directory do not show up when I launch the code to my 'localhost:XXXX' sandbox.
For example, I'll import one of my scripts and invoke some functions, and I get the error below.
The weird thing about this error is that the 'exec()' call is no longer at line 99 in the copy of 'main.py' that I have been revising.
Traceback (most recent call last):
File "/base/data/home/apps/[app name]/1.354953192642593048/main.py", line 99, in post
exec(cmd, safe_globals)
File "<string>", line 5, in <module>
NameError: name 'myFunction' is not defined
I guess my questions are:
1) What/where is '/base/data/home/apps/[app name]/1.354953192642593048/main.py'? Is this where they compile and run everything?
2) How can I 'rebuild' the local copy of my app folder such that the revisions I make are reflected in the sandbox?
Sorry for this relatively vague question. If somebody could explain how the sandbox is setup so I can figure out how to properly do debugging I would appreciate it.
UPDATE:
Never figured out how / why this error occurred. The output from that app engine directory was totally static no matter what kind of changes I tried to make, so I just deleted the folder and opened a new one. With this new folder (same exact contents, including app.yaml and main.py), I can make changes on the fly and my local debugger reflects those changes.
No longer a pressing issue, but if anybody has an idea as to how / why this error was occuring, I would be interested to hear it. As suggested in the comments below, the path provided in the error message is highly indicative of the workings of some remote base/ directory, even though I have been running everything on my localhost:[Port#] without any app deployment.
Are you sure you're running it locally? The traceback looks like it's from the app server. The '/base/data/home/apps/[app name]/1.354953192642593048/main.py' looks like the path to your application on Google's app server, not a Windows file path.