I've done tons of research on my issues, and I haven't really found an answer:
I'm trying to use Kivy in Eclipse on my computer. I've got an environment setup already, and I installed Kivy and the dependencies just like this:
https://kivy.org/docs/installation/installation-windows.html#
I copied the first bit of code from the tutorial on their site which should simply make a blank window, and upon running I got this error:
sdl2 - Exception: SDL2: Unable to load image
...
[CRITICAL ] [App ] Unable to get a Window, abort.
Just from that, I found tons of people with the same issue. issue 3002 on kivy's github (sorry, I can't put too many links) suggests solutions for linux users, which doesn't help me.
This: Trying to run KIVY, for the first time suggests installing pygame, which I've done multiple times, but it looks like the last update for pygame was in 2009? (I looked at their main site)
Either way, I installed pygame and that didn't change a thing. I also looked at issue 3491 (again, can't post more than 2 links) which seems very applicable but suggests downloading drivers from my GPU vendor, which I have no idea how to do, or what GPU I even have.
Is there any solution to my problem? Do I have to try and figure out how to get correct drivers? Also, I am using WinPython if that matters, but it seems to work for everything else...
Paste output of echo %PATH% here. Feel free to cut of personal things, I only want to know if sdl2 is available on the path (which I think is not). If not, add it. Should look like this:
<python.exe dir>\share\sdl2\bin
If it doesn't work for you, well... I'm still sure it's deps & path-related error. I usually annoy people with a link to my installer's github repo when I see similar error. I have there this line:
set PATH=%~dp0;%~dp0Tools;%~dp0Scripts;%~dp0share\sdl2\bin;%~dp0Lib\idlelib;%PATH%
Put <python dir>\Scripts on path too, because of garden, pip and other stuff.
Related
I am trying since many hours, after watching several tutorials and reading many blogs I've setup variables as shown by them. Tried all of their methods to setup python3.9 on my windows cmd, but failed. I'm sharing some screenshots of my system variables and other things, please look into the problem and help me.
When you want to share on your post the errors you are getting, please insert them using the Code Sample function so that we can clearly read your errors and have a clear look at your situation.
Anyways, when you first install Python you have to option to automatically add Python to PATH, try uninstalling and checking that option.
If this doesn't work, paste inside your post the error you are getting.
EDIT: Can you share a screenshot of your Python directory?
First of all, I am new to both Python as well as the world of VSCode (recently moved over from Atom). I will also say that I am using an Early 2014 MacBook Air running macOS Catalina. I really do love VSCode! It's amazing in many ways, but this... this is just too unclear.
Okay, I have tried literally almost everything and I don't understand why my imports won't work! I have looked at the documentation on the issue on Github (I will say I may have something with the directory wrong there, referring to the docs). I have tried the "python.autoComplete.extraPaths": [], thing. I have tried changing my (virtual) environment and, of course, setting up a new one myself. I have tried setting "python.languageServer:" to Jedi and back to Microsoft. I can't even find the "python.jediEnabled: false" comment that everybody is telling me to uncomment.
Yet, my imports are still "unresolved (Microsoft language server)" or "not found (Terminal)" or "unable to be imported (Pylint)". It just makes me so angry and I don't understand what I've done wrong!
I've seen modules like pygame and requests work just fine on VSCode for many others (YouTube), yet mine has yet to work.
Can someone please tell me the secret that I don't apparently know? Thanks.
Update Post: My Virtual Environment is using my System Python rather than my Venv's Python
Thank you for everyone who has helped (so far). I am getting a lot closer to solving this. ^-^
They had removed "python.jediEnabled" setting instead of "python.languageServer", you can refer to here.
Maybe you haven't installed the package which you want to import, because you had used the wrong 'pip'. When you select the right environment, you need to activate it(Ctrl+Shift+`), otherwise, you'd use the wrong 'pip'. You can type 'pip --version' to check which 'pip' you are using. Then you can try to install the package you want to import.
Im going through the Microblog tutorial for Flask designed by Miguel.
I made it to part 4 without any issues. Everything ran in the end of part 4.
I started having issues in part 5. After a couple of tries and trying to troubleshoot with the comments in the page, I was not able to finish the exercise.
Thinking it was me, I deleted all of my project and replaced them with the zip downloadable in the page for the exercise. I still get the same error, so the problem is not the code itself.
I get the following error when running views.py:
Link to image on imgur (couldn't post it here due to not having enough reputation)
Here are the libraries I have installed:
Link to image on imgur (couldn't post it here due to not having enough reputation)
My setup:
I am using Pycharm to run the files. This machine runs Windows and I found that Pycharm is the most efficient way to run things without dealing with issues with the cmd line.
Python 3.4
virtualenv created by Pycharm
the code can be found on github: github.com/pdgonzalez872/microblog
Potential cause of the problem:
The problem may be with the path that I have set up (but why did it work until part 4?)
The code itself (maybe something was updated in flask/other libraries since the post?)
views.py isn't meant to be launched separately, there is run.py file to start the project.
Also, it uses relative imports (those with dots before module names), which don't work when you use them in a script passed to the interpreter and used as main. Sorry, I can't explain it well, but maybe you will be interested in those links:
https://docs.python.org/2/tutorial/modules.html#intra-package-references
How to do relative imports in Python?
I started getting this error every time I try to:
install Python package with installer
use PyWin extension (through COM application)
start Notepad++ (with Python script plugin)
This started to happen couple of days ago.
Dialog shows, I dismiss and everything runs fine, except it pops again and again
I reinstalled Python 2.7.3 on Windows XP SP3 32bit, then reinstalled PyWin extensions, but nothing changed.
Looking for answer here, I found that obviously some library is missing manifest declaration, but I can't figure which one. Or what is loaded by default in all above mentioned 3 scenarios. Does anyone maybe has an idea?
I found it - it's PyGTK. I installed it couple of days ago, and I did suspect on it, but wasn't sure and didn't wanted to mislead.
I renamed gtk-2.0 folder in site-packages and dialog stopped to show
Will contact the team and report back if I have something
Update
I tried to contact PyGTK team, couple of days ago, but the list seems very low frequency, I wonder who uses PyGTK on Windows. This is the link to reported problem in case anyone cares: http://www.daa.com.au/pipermail/pygtk/2012-November/020462.html
And in case anyone is curious what did I do with this error dialogs, here is answer: I used PyGTK as I needed it by one project, which I now compiled to executable and got rid of GTK from my Python packages.
If you know what application or library is failing to load, you can use Dependency Walker to show any missing dependencies.
I have had trouble setting up the pycharm ide on my macosx10.7 with python3..
I have scoured every resource available and tried hundreds of approaches, at this point I must accept my incompetence and seek help via this channel.
In my research, I notice a lack of ground-up explanations on python integration into macosx and how to configure pycharm to import modules, run code within the editor, etc. If i ever solve this I will make a very detailed tutorial.
I have imported python3 successfully, it looks like it is linked appropriately from /sys/lib/frameworks to /usr/lib ...etc -- version control is working just fine.
I think my issue is either in setting environmental variables (tried the program to fix this and tried macports) and in the script needed to execute. it will catch errors throughout but final product does not run in python and returns printout of :
/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/pythonpractice/Py_Ex/classes.py
Process finished with exit code 0
i really need to get this configuration sound for my python programming class. please help (I've been through every line of pycharm website) .. preferably is there a way to map it via terminal? thanks for anyone who took the time to read this.
Summary of the discussion above:
Python 3.2.2 installation was broken on this Mac, installing ActiveState Python 3.2.2 from scratch and configuring it in PyCharm has fixed the problem.
Python path to be used in PyCharm settings: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3
Incompatible third-party plug-ins may break PyCharm, uninstall/disable them in Preferences | Plugins.
Ensure the latest PyCharm version is installed.
User's code depends on the graphics.py module which was not in the project or in the PYTHONPATH. Putting it into the project has solved the problem.
Most likely the wrong Run/Debug configuration was used in PyCharm, the easiest way to run or debug such scripts is by using the editor context menu Run and Debug actions. PyCharm creates the configuration automatically and debugging works fine as shown of the screenshot:
If one wants to configure and debug it, he can use the code.zip file to get started.
Sorry for the comments mess above, but it was not possible to move it into chat as user had only 1 reputation point, hence not able to use the chat feature of StackOverflow.