Kivy Configuration Ignored - python-2.7

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.

Related

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

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?

Missing module to read MS Access using python

I was trying with the situation described in this question - Read an Access database in Python on non-Windows platform (Linux or Mac)
I downloaded the jython 2.5 jar file tried setting up the class path, but I am getting the error:
No module named com.ziclix.python.sql.
I dont know if i am doing it in a wrong way,
I just could not figure out how to configure odoo directory..
Jython includes com.ziclix.python.sql in "jython.jar" itself, so no external dependencies should be required. If you are able to get Odoo to run under Jython (instead of CPython) then com.ziclix.python.sql should be available.

Deploying Qt Qml App to Windows shows me a blank window

After suffer with a lot of problems trying to deploy a Qt/Qml app to Windows 8, as I described in this question: Deploying Qt Qml app to Windows 8 shows me a blank window
I could make it work copying the Qt5Widgets.dll... but it was only working in my own development machine (installing it there, but yet my own machine).
Then I tried to install it in another machine (a VM running Windows 7).. and at first I got error of missing platform plugin... ok, I copied qwindows.dll to appDir/platforms, and it seems to resolved this problem.
But then I got another missing dlls errors (the ones related to VS2010), then I installed the Visual Studio 2010 redistributable package... ok, now the app starts, but with a blank window :(
The qml files and everything are in a resources file, so it should be in the binary.
And I've no idea where to go from there to find this issue.
Any idea what can I do? The weird thing is that it was installed fine in my own development machine.
And my conclusion is that deployment of Qt in OS X is much easier.
I've solved the problem with these steps:
check your qml files path. For example default generated code is the following:
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/test/main.qml"));
So qmls should be in "qml/test" folder
check the missing dlls:
download VmMap tool from Windows Sysinternals suite (http://technet.microsoft.com/en-us/sysinternals/dd535533)
compile and run your app in qt creator to get it working like it should
run VmMap and open your running app's process.
sort the lower window by 'Details' - so you'll see all loaded DLLs sorted by path.
copy the missing dlls. It should work now!
I've had also a lot of trouble deploying Qml apps with a blank window too.
In general this site gives useful hints:
https://qt-project.org/doc/qt-5.1/qtdoc/deployment-windows.html
The blank window issue was caused be two different things in my case:
The relative path to the qml files were not correct. I've solved this by storing the qml files in a resource file and then calling them from there.
It seems to be a problem if the application is located on a network drive. I haven't found a solution for that except copying the application to a local folder.
In general I think deploying is a big big pain :-/

Newly created Pydev Django Project does not include initial package with Settings.py etc

When creating Django Pydev projects in Eclipse the default config package is created automatically with the following structure:
MyApp
__init__.py
settings.py
urls.py
wsgi.py
manage.py
Today I created a Django Pydev project and those files and initial package were not created.
I have tried several times to create new Django Pydev projects but the the initial structure is not being created.
This problem only just started happening. I have not had the problem prior to today.
Running this on the command line does work:
django-admin.py startproject mysite
The files and project structure are created correctly. So it's just Eclipse and Pydev that fails.
I am using Django 1.4, Pydev 2.5 and Eclipse Indigo 3.7 on Ubuntu 11.1
I had the same issue today but it turned out that it was because my project name was not handled - eg "My Project". The space threw it. Calling the project "MyProject" worked a treat.
From the cmd line it gives the following error - which eclipse is not returning:
c:\django-admin.py startproject "My Project"
Error: "My Project" is not a valid project name. Please use only numbers, letters and underscores.
I ran into the same issue on win7.
I also tried to run django-admin.py manually from command line. Instead of generating a project, it opened up a default editor for .py file. Then this was clear to me that it was because I installed some program which registered itself as the default program to run .py file. In my case it was WebMatrix2 but even if you don't install anything, there is a good chance that it is set to notepad by default by win7.
I knew that PyDev will actually run django-admin.py to generate the project. So my guess was that PyDev tried to run the .py file. Then since the program to run it was not python.exe, nothing was generated. PyDev ignored this error so there was nothing in the project.
Then the fix is simple. Choose any .py file, right click to open the properties window and change the default program to python.exe.
Now go back to Eclipse and try to create a django project again. You should be able to see manage.py file and other files created.
Hope this helps.
I was having this problem - I tried to create a project called test-django, and it wouldn't add manage.py etc to the structure. So I tried doing the same thing with django-admin.py and it failed and said only numbers, letters and underscores!
So the problem is that eclipse/pydev fail to report this error and make the project anyway!
I had a similar issue today (Win7). I had been using eclipse, PyDev and Django for a while and had no problems. Tried to create a new project today, and it failed to populate the project folder with manage.py etc.
I happen to have both Python 32 and 64 bit installed, but Django 32 bit. I forgot to select the 32 bit interpreter when I created the project, and so it called the 64 bit interpreter to run django-admin.py and failed silently. Once I selected the 32 bit interpreter it created the project folders as expected.
Met the same issue when creating a PyDev Django project in the virtual environment.
Unable to find out any effective solution either in Chinese or English. After a few tries, I've managed to resolve it
When creating the PyDev Django Project, instead of putting your project folder in the virtual environment folder, you need to choose another directory outside.
Eclipse Pydev Screenshot
I tend to believe this is a PyDev bug, as I can put my django project folder anywhere using the command:
django-admin startproject PROJECT_NAME.
It works fine in the virtual environment folder. Refer to my setup environment below:
Eclipse Oxygen: 4.7.1a
PyDev : 6.1.0.201711051306
Django : 1.11.7
Just to note, provided you have the latest PyDev, this should work (previous versions had issues with Django 1.4) -- it's possible that it's just missing a refresh (i.e.: it's creating it but not showing in the PyDev package explorer).
Just refresh it and see if it works -- and make sure you have 'refresh using native hooks' and 'refresh on access' selected on window > preferences > workspace.
If you still have an issue, please check if they really weren't created in the filesystem and if they weren't check your error log for some error there and report back.
Had the same issue.
Fixed by doing Help -> Check for Updates.
Updated Eclipse and restarted.
i met this issue, too.
However, after devastatingly searching online. I'd decided to re-install the plugin with a brand new Eclipse for Java EE Developer, Version: Indigo (previous was Classical Eclipse, Indigo).
And it worked!
I know this question was asked long time ago, but I faced the same problem with Eclipse Neon and I figured out possibly there is a bug.
I guess you used File>New>PyDev Project to create a project. I used MyProject as the name of the project so I did not have any space in the name, and therefore project name could not be the issue. You should see 3 steps to configure your project, while the 3rd one is not shown. The 3rd step is Django Setting and if you cannot get to that step, your files will not be created.
Instead if you use CTRL+N, you will see a different wizard and this way it takes you to 3rd step and all the file will be generated.

Eclipse/PyDev + Django debug

Eclipse/PyDev, Python 2.6, Django 1.1
All is working in run mode. If I put debug point inside manage.py file, breakpoint worked. But when I putted it in any action method, it causes nothing :(
Usually the problem is that you're running with auto-reload in django, in which case a different process is actually feeding the pages, so, you need to run it with the no reload option or use the remote debugger.
(To configure PyDev to work with Django see: http://pydev.org/manual_adv_django.html)
Note that if you want to execute without the auto-reload feature (which PyDev should do automatically when you create a new Django run), you can do all directly (i.e.: the debugger and launching don't need any special adjustments).
Note: the situation has improved a bit recently, so, although the above answer is still valid, there are improvements for those that do want to develop with auto-reload on:
Answer with auto-reload on:
If you want to have auto-reload on while developing, use the tips at: PyDev and Django: how to restart dev server? (to overcome an issue where Django will leave child processes alive when the main process is killed)
And see the session related to the remote debugger at: http://pydev.org/manual_adv_remote_debugger.html to see how to attach the debugger to PyDev when using the auto-reload feature (mainly, you'll need to start the remote debugger, but will add breakpoints regularly and PyDev will stop on those provided you call pydevd.patch_django_autoreload() before you main session -- i.e.: before if __name__ == "__main__":, add the following: import pydevd;pydevd.patch_django_autoreload()).
also if while attempting to import pydevd eclipse can't find the pydevd depependency. Make sure to add it from your plugins folder:
Look for your eclipse/plugins/org.python.pydev_x.x.x/pysrc where x.x.x is your eclipse pydev plugin version. In the eclipse/plugins folder you will find lot's of folders that start with a similar name only one of them will have a pysrc subfolder(and the right version number).
Add eclipse/plugins/org.python.pydev_x.x.x/pysrc to your project's external libraries:
Right click on your project explorer.
Go to properties/PyDev - PYTHONPATH/External Libraries/ and click on Add Source folder.
Find your eclipse/plugins/org.python.pydev_x.x.x/pysrc folder on the provided browser.