Issue
- I am using Python37, Kivy 1.11.1, and Spyder3
- I am unable to import kivy as a module
- I followed these instructions exactly, and set up a venv for it as suggested
- The file for the Python script is saved within the venv that contains kivy
- Here is the code run:
import kivy
And the error code, in full is:
runfile('C:/Users/Liam/kivy_venv/CL_APP.py', wdir='C:/Users/Liam/kivy_venv') Traceback (most recent call last): File "<ipython-input-10-99293c9bbf5a>", line 1, in <module> runfile('C:/Users/Liam/kivy_venv/CL_APP.py', wdir='C:/Users/Liam/kivy_venv') File "C:\Users\Liam\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile execfile(filename, namespace) File "C:\Users\Liam\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/Liam/kivy_venv/CL_APP.py", line 8, in <module> import kivy ModuleNotFoundError: No module named 'kivy'
The executed code.
Lower right is the error code recieved.
If I am leaving out anything important please let me know. I assume I am just rusty and don't know how to import modules correctly and its likely an issue with where kivy is saved in my computer compared to where the Python script is.
Separate question and possible hint, I only have Python37 installed but the IDE says, in the top left corner, that it is Python 3.6. Could this cause an issue with this or anything else?
Thank you.
Solution
The answer was there was an issue with my Anaconda files, i uninstalled and re-downloaded Anaconda and then use the anaconda prompt to download kivy and that fixed my problems.
EDIT:
there was issues with my anaconda files, however if one were to need to install Kivy on their device and also use Spyder on Anaconda as their IDE, all one needs to do is locate their Anaconda Prompt, found somewhere like C:\Program Files\Anaconda\bin\Anaconda.exe
, I do not have Anaconda installed and am not certain of that path.
Once in the anaconda prompt run:
conda install kivy=x.x.x
Answered By - Liam O'Toole
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.