ee.mapclient with python 2.7 and Anaconda, possible alternatives? - python-2.7

I have installed the google earth engine python APIs in my MAcOS where also Anaconda is installed. I got problem with the object ee.mapclient. I made it working modifying the line of the import using
from PIL import Image, ImageTk
Now it does not produce error message but it is not working either. When I run a script in Spyder the console returns several message and it enters in loop.
Running the same script line by line in the console, a big black window is opened but nothing is displayed.
Is there any solution to make it working? I know that the developer is not maintaining this object because too dependent to TK libraries. Is there any other solution to display satellite data?

Related

Tkinter no $DISPLAY or display name (Berkley pacman project)

I am trying to use Berkley's AI pacman projects.
Specifically this project.
A little bit about me: I'm on Windows 10 using cygwin as my terminal. I have both python and python3 installed as well as both versions of Tkinter and tkinter respectively. This project uses python 2.7. Trying to run the main project using the python pacman.py results in a long trace with the error being '_tkinter.TclError: no display name and no $DISPLAY environment variable'.
Calling echo $DISPLAY outputs an empty string.
I believe this is the most relevant file:
http://ai.berkeley.edu/projects/release/search/v1/001/docs/graphicsUtils.html
I understand this is a relatively specific and difficult issue, but any advice would be greatly appreciated. Thank you in advance!
Edit: I have installed xwin and the relevant packages. I am able to start a server in one terminal with startxwin and then I try to run the same command in another terminal but arrive at the same issue. I believe my problem is that I cannot establish the xwin server as my $DISPLAY.

nfcpy python 2.7 pyinstaller

I am working on project that reads near field communication card and identifies the card user, I am using nfcpy with python 2.7, my nfc card reader is acr122 by ACS and I am working on windows 10. The application seems to be working fine when I run the python script. However, when I convert the python script to .exe using pyinstaller I have error "no module named acr122". Is there any specific protocol I have to follow to bundle nfcpy in exe file. Any help would be much appreciated, Thank you in advance.
finally, found a solution, I need to import ['nfc.clf.acr122'] as hidden-input.

Python IDLE giving startup error

I have just installed kivy in python 2.7.11. After installing it, whenever i try to open IDLE, it is giving subprocess startup error.
Actually i installed kivy on my windows 7 PC through command prompt. After installation, I copied programs of kivy from my android tab to run them on my pc. When I tried to open them, IDLE doesn't respond for some time and after some time it gives startup error. Since then IDLE is not starting .
But it is quite strange that, on running python builtin module, there is no error.
I had reinstalled python but still there is no change.
reason for subprocess startup error can be a new python file that you have created recently with the same name as same existing libraries or module name
e.g. 're.py','os.py' etc
beacuse re,os are the predefined libraries
just go and find the file and rename it
hope so it will be resolved

Kivy Configuration Ignored

I am working on Ubuntu 14.04 64bit. Default python 2.7.x package. Custom built Kivy (rather, it is not the kivy supplied in the repositories. I used pip to gather dependencies and build Kivy in a Virtualenv)
For some reason, I seem to have no control over a large portion of my runtime Configuration. I have tried using environment variables, kivi.ini in my working directory and home directory. I have tried directly importing the kivy.Config module at various different points in the runtime (before the Kivy App is built, during, after).
It seems that I cannot configure certain Kivi settings (default screen size for instance). My Kivy application is quite functional, but I am having trouble finding where Kivi looks for default configurations, and where the proper place is to override. I have tried many different ways, but it seems there is some master configuration that is taking priority and I am not able to override.
Am I missing something simple? Does this have anything to do with the virtualenv (and how Kivy was built)?
I have tried directly importing the kivy.Config module at various different points in the runtime (before the Kivy App is built, during, after).
If this is to work, it should be before anything else is imported.
Also, kivy is probably looking for the config file in ~/.kivy/config.ini.

How can I get the figures from matplotlib on top of the windows with spyder?

I am using spyder with python to plot some images with matplotlib. When I generate a figure it is not showed on top of the windows, but hidden.
How can I get the figures on top?
I have this problem in Windows and Linux.
This is the code:
plt.figure(0)
plt.imshow(img)
Thanks for your help !
I had the same problem, with Spyder 3.3.2, (python 3.7) and QT5 backend.
The answer in this older query says you may use a trick with TkAgg backend. (at least, the trick does not work with my QT5 backend)
So I switched the backend in Spyder preferences (Tools==> Preferences ==> Ipython ==> Graphis ==> backend).
and now, my windows already comes on top without any other tricks...
Unfortunately there is no way to do what you're asking for because Matplotlib doesn't have the functionality to make it possible. See this issue for more details.
This has been bugging me for a while and I've discovered an answer in an older query
Basically, make window "always on top", then undo that so that other windows can then come on top again.
Code to add after your plot:
#Put figure window on top of all other windows
fig.canvas.manager.window.attributes('-topmost', 1)
#After placing figure window on top, allow other windows to be on top of it later
fig.canvas.manager.window.attributes('-topmost', 0)
I met the same problem yesterday. but I found that if you open the Ipython qtconsole at the same time, the figure window will turn out