So, using the python-firebase pip module, the following code:
from firebase import firebase
print 'test'
Causes the following output:
test
test
test
test
test
Commenting out the import, or importing any other modules, causes test to be printed only once as expected. This is happening on my 2 windows machines at home, with different version of python. My linux boxes at work are not showing this behavior. Extremely weird. Anybody know what could possibly be going on?
The pip install of firebase hasnt been updated and has some bugs in it. Take the latest version from Github you should be fine after using this version.
There is a very good blog post on getting started with this python-firebase here burhan.io check it out :-)
V
Related
So I've cloned this
https://bitbucket.org/romildo/django-jqgrid-demo.git
as I am looking for a working example of jqgrid with django.
I've been updating the code (as this seems like it was written for a version 2 of django and I'm workng on 4.1)
I'm completely stumped by the lines
from jqgrid import JqGrid
giving me this error
ModuleNotFoundError: No module named 'jqgrid'
I cannot find a reference to jqgrid within pip and I cannot install one (jqgrid is not a python package)
I understand that jqgrid is a javascript component around jquery but how do I get that to work in Python
I have google for django-jqgrid and on youtube. None of the answers provide enough information to get a simple working example up. There seems to be an assumption that everything is installed and I'd like to understand what is required where and how to reference
What am I missing?
Simply you can install this library:
pip install js.jqgrid
And now your above error will solve
Background: I have been working in Python to create a lambda function that will hit the Binance API to fetch balances and transactions. To deploy, I have been using the Serverless Framework (https://serverless.com/) and virtualenv which has made it a breeze up until this point. I have 2 other functions working perfect with other exchanges.
Error: When I deploy, I am getting the following:
Unable to import module 'getBinanceTransactions': No module named '_regex'
getBinanceTransactions being the function I created to return what I want. Nothing crazy, just following the python-binance documentation (https://github.com/sammchardy/python-binance) to grab all transactions and then data wrangling.
Note that this works on my local machine!
I do a serverless deploy, and everything updates just fine using serverless-python-requirements to package everything separately. Here are my imports (only 2 external packages):
from __future__ import print_function
import json
from binance.client import Client
import pymysql
And my requirements.txt, with both this and the code separated in a directory just like the other I have working in a similar format:
PyMySQL==0.9.2
python_binance==0.6.9
I have been searching for the solution but no one has seem to run into this problem. It also seems that _regex is a code method to Python which makes the situation even more strange.
I have tried wiping my virtualenv out and rebuilding, rebuilding the entire file structure, pip freeze >> requirements.txt on installing both packages to make sure nothing was missed, changing the name of the imports and requirements, importing regex/re in my function, even switching to Python 2.7 for a hail mary. Nothing seems to work (despite the others working) and I get the same error every time.
Does anyone have any ideas?
For the past couple days, it's been working fine. But today, I was trying fix some encoding issue, and it just suddenly stopped working. I reverted my code back to what it was like from before, but for some reason the error is still there. (And so is the encoding issue, sadly.)
I am using MySQL with MySQLdb on Python 3.6.2 and Anaconda. I am aware of MySQLdb's incompatibility with Python 3 and with Anaconda. However, I do not want to use Python 2 or a different driver.
I have worked around this by installing mysqlclient, and I am able to do import MySQLdb in the Qt console. I was also able to create an engine with below code literally 30 minutes ago.
from sqlalchemy import create_engine
engine = create_engine('mysql://user:pass#localhost:3306/db?charset=utf8')
I checked my code with the one I had on the remote repo just to make sure there was no mistake. It's exactly the same. Yet now I'm getting the following error:
NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql
Which seems very odd considering that I have both. This error is seen when I run my script in the Qt console with %run myscript.py. I've been doing that since yesterday without any issues.
I am not using any virtual environments as I found it a pain to manage them on Windows and with Anaconda. I also checked that MySQLdb is importable in the console before running the script. So I know the module is properly installed.
I tried to figure out what's going on, and during my investigation I found out that I'm missing sqlalchemy.connectors module, but I'm not sure if that actually is an issue because I can't find any similar issues online. Here's what I did to get that error:
from sqlalchemy.dialects import mysql
ModuleNotFoundError: No module named 'sqlalchemy.connectors'
Does anyone know what the issue is? This is really frustrating because this seems to be completely out of blue :/
** I just tested whether other drivers work (i.e. pymysql), and it doesn't. I think it's because sqlalchemy is rejecting the dialect regardless of the driver.
EDIT: To reproduce (at least on my machine at the moment) I only need 2 lines.
from sqlalchemy import create_engine
engine = create_engine('mysql://user:pass#localhost:3306/db')
EDIT2: I identified it as an Anaconda issue, however I'm still unsure what the cause is.
Clean reinstall of sqlalchemy have fixed the issue.
Can't believe that wasn't the first thing I tried.
I still have no idea how it got corrupted, though.
$ conda uninstall sqlalchemy
$ conda install sqlalchemy
I'm using netbeans to write a simple python program which I need the requests module for, I've downloaded requests through terminal and it all seems to be fine there but netbeans can't seem to find it.
This is the error that it's throwing up:
import requests
ImportError: No module named requests
I've tried installing the requests library directly into the python folder but the folder won't let me paste anything into it.
There do seem to be answers on the netbeans forums but their server is down so won't let me on their website to my annoyance!
EDIT
I've tried to run python setup.py install as per other answers on the website but had no luck.
EDIT
have tried completely uninstalling python and requests to make sure it wasn't an installation error but still no luck.
This clearly looks like an error of installation of the request module to some other place than where your netbeans expects when running the code.
In your console run
which python
Check if this gives the same path as the one set in your netbeans. You can set your path by adding new platform using Tools > Python Platforms > New:
I would suggest that you learn bit more about sandboxed environments such as virtualenv. This article shows how you can use a virtualenv to install packages and use the same virtualenv for netbeans so that whatever packages you install in the virtualenv will be available in the netbeans for you to use. For this case, it could be requests.
In the end I gave up with requests, as I was using requests to get json data from an API I decided just to go back to the drawing board and start over rather than attempt to fix something that I couldn't work out. I am now using the urllib import and whilst this may not be the most efficient way it works which is the most important thing.
I've installed mesos 0.26 successfully on a vm machine.
The installation has been performed on an ubuntu trusty thar system
by following this manual:
https://open.mesosphere.com/getting-started/install/
So far so good. I wanted to write a tiny python framwork.
For this I need to install the eggs via easy_install:
(I've downloaded the eggs accordingly for the trusty thar ubuntu and the 0.26 mesos):
wget http://downloads.mesosphere.io/master/ubuntu/14.04/mesos-0.26.0-py2.7-linux-x86_64.egg
easy_install mesos-0.26.0-py2.7-linux-x86_64.egg
all went fine, however, if I start python in the shell
and type in
import mesos.interface
I get the message: ImportError: No module named interface
As someone suggested, it may be that there is no longer a binding for python, or that they have renamed the API calls. Well, I looked in the version updates here:
http://mesos.apache.org/documentation/latest/upgrades/
Since the transition from 0.19.x to 0.20.x there hasn't been any changes regarding the mesos.interface part, or at least they are not mentioning it here.
To increase the confusion I also get the following error message when I'm typing in python: import mesos.native
There I receive: ImportError: No module named interface.mesos_pb2. To put it into a nutshell: what is going wrong here, and how can it be fixed? And yes, I've googled various web pages, with terms such as "mesos python bindings", mesos +api +python, etc. And yes, I have also consulted the official mesos webpage. There are nice refences for Java and C++ but not for python, or at least they are very well hidden.
Thanks in advance for any hints.
Solved. For what reasons ever:
export PYTHONPATH=${PYTHONPATH}:/usr/lib/python2.7/site-packages/
is required to set the PYTHONPATH. After that step it works like a charm.